You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Tom Condon <to...@vrtx.com> on 2003/10/08 18:29:41 UTC

Namespace Question...

I have a schema that uses the prefix "hv:" for a namespace I have 
defined.  I have no problem reading documents that conform to my 
schema.  When I write a document, the prefix "ns:" is used.  I know 
that this works in the schema world, but my document is getting read in 
by a SAX parser that expects a specific prefix.

How do you specify what prefix is used for your namespace?

Thanks for any help,

Tom Condon


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Re: Namespace Question...

Posted by Roland Schemers <sc...@stanford.edu>.
Something like the following should work, if I recall correctly:

HashMap suggestedPrefixes = new HashMap();
suggestedPrefixes.put("http://foo.com/", "foo");
XmlOptions opts = new XmlOptions();
opts.setSaveSuggestedPrefixes(opts);

String output = document.xmlText(opts);

roland

On Wednesday, October 8, 2003, at 09:29  AM, Tom Condon wrote:

> I have a schema that uses the prefix "hv:" for a namespace I have 
> defined.  I have no problem reading documents that conform to my 
> schema.  When I write a document, the prefix "ns:" is used.  I know 
> that this works in the schema world, but my document is getting read 
> in by a SAX parser that expects a specific prefix.
>
> How do you specify what prefix is used for your namespace?
>
> Thanks for any help,
>
> Tom Condon
>
>
> - ---------------------------------------------------------------------
> To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
> Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
>


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Re: Namespace Question...

Posted by Roland Schemers <sc...@stanford.edu>.
Something like the following should work, if I recall correctly:

HashMap suggestedPrefixes = new HashMap();
suggestedPrefixes.put("http://foo.com/", "foo");
XmlOptions opts = new XmlOptions();
opts.setSaveSuggestedPrefixes(opts);

String output = document.xmlText(opts);

roland

On Wednesday, October 8, 2003, at 09:29  AM, Tom Condon wrote:

> I have a schema that uses the prefix "hv:" for a namespace I have 
> defined.  I have no problem reading documents that conform to my 
> schema.  When I write a document, the prefix "ns:" is used.  I know 
> that this works in the schema world, but my document is getting read 
> in by a SAX parser that expects a specific prefix.
>
> How do you specify what prefix is used for your namespace?
>
> Thanks for any help,
>
> Tom Condon
>
>
> - ---------------------------------------------------------------------
> To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
> Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
>


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/