Closed GoogleCodeExporter closed 9 years ago
Hi Simon,
The easiest solution may be to remove the namespace declaration from the
writer's "namespaces" property. Is there any reason you declared it there if
you didn't want to use a "d" prefix?
Thanks,
Kevin
Original comment by kevin.s...@gmail.com
on 22 Apr 2012 at 9:40
Yes, I refer to that namespace later on (lines 141 and 155).
Original comment by goo...@sa.me.uk
on 22 Apr 2012 at 9:56
Attachments:
Unfortunately, some DOM implementations do not accept empty string prefixes, so
the fix will not be as easy as I had hoped, but it can be done...
Original comment by kevin.s...@gmail.com
on 23 Apr 2012 at 2:21
Fixed for 1.2.5.
Please try the attached 1.2.5-snapshot JAR and let me know if you have any
issues.
Original comment by kevin.s...@gmail.com
on 29 Apr 2012 at 4:11
Attachments:
I'm using 2.0.0.M1 so I can't test that as the config file isn't compatible.
Original comment by goo...@sa.me.uk
on 29 Apr 2012 at 11:35
Ok, try this 2.x snapshot JAR. For the record, your mapping file in the defect report is a 1.x mapping file.
Original comment by kevin.s...@gmail.com
on 30 Apr 2012 at 4:04
Attachments:
It does something odd at the start with what should be the default namespace:
<zdef-247938963:cursus xmlns="" xmlns:d="urn:oid:1.3.6.1.4.1.39777.1.0.1.0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:zdef-247938963="urn:oid:1.3.6.1.4.1.39777.1.0.1.1.1" generator="cursus
0.0.1" xsi:schemaLocation="urn:oid:1.3.6.1.4.1.39777.1.0.1.0.1
https://xsd.s85.org/urn/oid/1.3.6.1.4.1.39777.1.0.1.0.1
urn:oid:1.3.6.1.4.1.39777.1.0.1.1.1
https://xsd.s85.org/urn/oid/1.3.6.1.4.1.39777.1.0.1.1.1">
After the element with the modified default namespace, there should be other
elements with the original default namespace but these are all in
zdef-247938963.
Original comment by goo...@sa.me.uk
on 30 Apr 2012 at 12:58
Alright, sorry for the delay, please try the attached 2.x snapshot JAR.
Original comment by kevin.s...@gmail.com
on 4 May 2012 at 3:40
Attachments:
It's almost correct but now the series element has an empty xmlns:
<cursus xmlns="urn:oid:1.3.6.1.4.1.39777.1.0.1.1.1"
xmlns:d="urn:oid:1.3.6.1.4.1.39777.1.0.1.0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" generator="cursus 0.0.1"
xsi:schemaLocation="urn:oid:1.3.6.1.4.1.39777.1.0.1.0.1
https://xsd.s85.org/urn/oid/1.3.6.1.4.1.39777.1.0.1.0.1
urn:oid:1.3.6.1.4.1.39777.1.0.1.1.1
https://xsd.s85.org/urn/oid/1.3.6.1.4.1.39777.1.0.1.1.1">
<series xmlns="" xml:id="Seriesf226ee0c4130">
All of the other elements are ok, including the use of d: later on in the file.
(Tested http://beanio.googlecode.com/svn/trunk@116 instead of the .jar as I
assume they're the same)
Original comment by goo...@sa.me.uk
on 4 May 2012 at 8:44
Would you mind posting a simpler mapping file that recreates the latest issue?
Thanks!
Original comment by kevin.s...@gmail.com
on 4 May 2012 at 9:32
I've tried to recreate the issue with the following sample, but did not have
any luck.
<template name="segment">
<field name="firstName" />
<field name="lastName" />
</template>
<stream name="stream11" format="xml" xmlType="none">
<parser>
<property name="indentation" value="2" />
<property name="namespaces" value="
s urn:segment
xsi http://www.w3.org/2001/XMLSchema-instance" />
</parser>
<record name="person" class="map" xmlNamespace="urn:record" xmlPrefix="">
<field name="schemaLocation" ignore="true"
default="urn:segment https:/blah.com/segment"
xmlType="attribute" xmlNamespace="http://www.w3.org/2001/XMLSchema-instance"/>
<field name="generator" xmlType="attribute" xmlNamespace=""/>
<segment name="segment" minOccurs="1" class="map" xmlNamespace="urn:segment" xmlPrefix="">
<include template="segment" />
</segment>
</record>
</stream>
Original comment by kevin.s...@gmail.com
on 13 May 2012 at 12:32
This issue is closed until further evidence is provided.
Original comment by kevin.s...@gmail.com
on 26 May 2012 at 7:57
The attached test case reproduces the empty xmlns issue:
org.junit.ComparisonFailure: expected:<...
<address xmlns="[urn:record]" e:city="San Franci...> but was:<...
<address xmlns="[]" e:city="San Franci...>
at org.junit.Assert.assertEquals(Assert.java:125)
at org.junit.Assert.assertEquals(Assert.java:147)
at org.beanio.parser.xml.XmlParserTest.assertXmlEquals(XmlParserTest.java:59)
at org.beanio.parser.xml.namespace.XmlNamespaceTest.testEmptyPrefix3(XmlNamespaceTest.java:379)
Original comment by goo...@sa.me.uk
on 5 Aug 2012 at 10:16
Attachments:
This still isn't fixed in 2.0.2
Original comment by goo...@sa.me.uk
on 15 Dec 2012 at 9:16
Thanks Simon, I have incorporated your test cases and am looking into the issue.
Original comment by kevin.s...@gmail.com
on 15 Dec 2012 at 9:08
Hi Simon,
I've attached a snapshot JAR that passes all test cases. I had to make some
significant changes to the way namespace are written out, so any regression
testing you could do against the JAR would be greatly appreciated.
Thanks,
Kevin
Original comment by kevin.s...@gmail.com
on 19 Dec 2012 at 3:27
Attachments:
Yes, it fixes the empty xmlns issue and the rest of the XML output is the same
as it was before. Thanks.
Original comment by goo...@sa.me.uk
on 19 Dec 2012 at 8:57
Fixed in release 2.0.3.
Original comment by kevin.s...@gmail.com
on 22 Dec 2012 at 4:25
Original issue reported on code.google.com by
goo...@sa.me.uk
on 22 Apr 2012 at 5:09