Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] naespace declaration lost

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Carsten Karkola" <carsten.karkola AT mailbox.tu-dresden.de>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] naespace declaration lost
  • Date: Sat, 18 Jan 2003 23:26:38 +0100

Hello,

I tried to print the following document with
nu.xom.samples.XMLPrinter:

<?xml version="1.0" encoding="ISO-8859-1"?>
<test
xmlns="http://www.tu-dresden.de/bau/test";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.tu-dresden.de/bau/test test.xsd">
<a>
<b>test1</b>
</a>
</test>

and I get

<?xml version="1.0"?>
<test
xmlns="http://www.tu-dresden.de/bau/test";
xsi:schemaLocation="http://www.tu-dresden.de/bau/test test.xsd">
<a>
<b>test1</b>
</a>
</test>

without the xmlns:xsi declaration. I think, the problem starts in
nu.xom.Serializer in line 239:
String currentURI =
element.getNamespaceURI(attribute.getNamespacePrefix());
// I think, this is always false, because the call to
// getNamespaceURI() finds the Attribute NS and so is
// attributeURI equal to the currentURI
if (!attributeURI.equals(currentURI)) {}

Regards, Carsten Karkola





Archive powered by MHonArc 2.6.24.

Top of Page