[jdom-interest] Problem with XMLOutputter with a Document validated with XSD

Ing. Terenzio Berni tberni at dianoema.it
Fri Jan 16 08:05:54 PST 2004


Hi all,
I have a file like this file in input
<ADT_A01
	xmlns="urn:hl7-org:v2xml"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="urn:hl7-org:v2xml ADT_A01.xsd">
	<MSH>
		<MSH.1>|</MSH.1>
		<MSH.2>^~\&amp;</MSH.2>
		<MSH.3>
			<HD.1>REGADT</HD.1>
		</MSH.3>
		<MSH.4>
			<HD.1>MCM</HD.1>
		</MSH.4>
		<MSH.5>
			<HD.1>IFENG</HD.1>
		</MSH.5>
		<MSH.7>
			<TS.1>199112311501</TS.1>
...cut...
and after validating it with its schema definition I modify some fields and
then I send it to the XMLOutputter.
The result is that I get an output like this:
<?xml version="1.0" encoding="UTF-8"?> <ADT_A01 xmlns="urn:hl7-org:v2xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hl7-org:v2xml ADT_A01.xsd">
	<MSH>
		<MSH.1 Item="1" Type="ST" LongName="Field Separator">|</MSH.1>
		<MSH.2 Item="2" Type="ST" LongName="Encoding Characters">^~\&amp;</MSH.2>
		<MSH.3 Item="3" Type="HD" Table="HL70361" LongName="Sending Application">
			<HD.1 Type="IS" Table="HL70300" LongName="namespace ID">REGADT</HD.1>
		</MSH.3>
		<MSH.4 Item="4" Type="HD" Table="HL70362" LongName="Sending Facility">
			<HD.1 Type="IS" Table="HL70300" LongName="namespace ID">MCM</HD.1>
		</MSH.4>
		<MSH.5 Item="5" Type="HD" Table="HL70361" LongName="Receiving
Application">
			<HD.1 Type="IS" Table="HL70300" LongName="namespace ID">IFENG</HD.1>
		</MSH.5>
This output contains all the data retrieved from the XSD but I would like to
strip it out and have an XML similar to the one in input.
How should I do this with JDOM?

Thanks in advance,
Terenzio




More information about the jdom-interest mailing list