[jdom-interest] How to set a reference to XML-Schema?
Patrick McFarlane
PMcFarlane at determine.com
Tue Nov 19 10:35:48 PST 2002
It's funny I just worked on something like this yesterday! :) You need to
create an extra attribute on your rootElement for the third row.
Element rootElem = new Element("updatetemplate");
rootElem.setAttribute(new Attribute("accountID",
"^^ACCTID^^"));
Namespace xsiNS = Namespace.getNamespace("xsi",
"http://www.w3.org/2001/XMLSchema-instance");
rootElem.addNamespaceDeclaration(xsiNS);
// this is the line that creates your third row.
rootElem.setAttribute(new Attribute("schemaLocation",
"../../xsd/updateTemplate.xsd", xsiNS));
patrick
-----Original Message-----
From: Haase, Christian [mailto:haase at mecklenburgische.de]
Sent: Tuesday, November 19, 2002 2:59 AM
To: 'jdom-interest at jdom.org'
Subject: [jdom-interest] How to set a reference to XML-Schema?
Hello everyone,
How can I set a reference to XML schema by generating XML-documents with
JDOM?
I do need e.g. this XML-Ouput:
<?xml version="1.0"?>
<ZusyMeldung xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.zusy.de/2002/XMLSchema"
xsi:schemaLocation="http://www.zusy.de/2002/XMLSchema ZusyAZ01.xsd ">
...
There are no problems with the first two rows, I do this with the
addNamespaceDeclaration method.
But, what should I do exactly for generating the third row with JDOM for
referencing the schemaLocation?
Has everyone an example for doing this?
Many greetings,
> Christian Haase
> haase at mecklenburgische.de
>
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
More information about the jdom-interest
mailing list