[jdom-interest] Schema Location

philip.nelson at omniresources.com philip.nelson at omniresources.com
Fri Aug 24 10:26:19 PDT 2001


> Hi,
> 
> As far as I understood the concept of namespaces there is no way for
> your problem -- unless you declare xsi to be a namespaceprefix itself
> with an attached uri, but I'm not shure if this won't provoce other
> difficulties.
> 

This *is* the way to do it.  You simply create a Namespace with 
Namespace ns = Namespace.getNamespace("xsi", "the uri");
Attribute att = new Attribute("schemaLocation", "the location", ns);
el.setAttribute(att);


The XMLOutputter will output the attribute as you expect with
xsi:schemaLocation

> ecky
> 
> > My apologies for sending this to jdom-announce.  I clicked 
> the wrong address.
> > 
> > I am trying to create a new XML document, and I am having 
> problems added the 
> schemaLocation to the root element. Below is a sample of what 
> I need the root 
> element to look like:
> > 
> > <TranXML_Envelope xmlns="http://www.tranxml.org/TranXML/Version" 
> xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" 
> xsi:schemaLocation="http://www.tranxml.org/TranXML/Version 
> T:\tranxml\version\schemas\TranXML_Envelope.xsd"/>
> > 
> > This is what I have so far:
> > 
> > <TranXML_Envelope xmlns="http://www.tranxml.org/TranXML" 
> xmlns:xsi="http://www.3.org/2000/10/XMLSchema-instance" 
> schemaLocation="http://www.tranxml.org/TranXML 
> ../schemas/TranXML_Envelope.xsd" 
> />
> > 
> > I cannot add xsi:schemaLocation as an Attribute because 
> colon is not valid in 
> an attribute, any help is appreciated.....
> > -- 
> > =====
> > ----------------------------------------
> > Do not meddle in the affairs of Dragons,
> > For you are crunchy and tasty with
> > ketchup
> > 
> > 
> > 
> > __________________________________________________________________
> > Your favorite stores, helpful shopping tools and great gift 
> ideas. Experience 
> the convenience of buying online with Shop at Netscape! 
> http://shopnow.netscape.com/
> > 
> > Get your own FREE, personal Netscape Mail account today at 
> http://webmail.netscape.com/
> > 
> > _______________________________________________
> > To control your jdom-interest membership:
> > http://lists.denveronline.net/mailman/options/jdom-
> interest/youraddr at yourhost.com
> > 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yo
uraddr at yourhost.com



More information about the jdom-interest mailing list