You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Maik Weber <Ma...@gmx.de> on 2001/08/15 17:20:46 UTC

schemaLocation

Hello,

can somebody tell me where you can use the attributes "schemaLocation" and
"noNamespaceSchemaLocation"? Do you only can use it in the rootelement or also
anywhere in the document? I have already look for this in the
w3c-definitions, but didn't find anything.

thx
maik

-- 
============================================
"Mögen die Falten im Gesicht eines Menschen
 Spuren sein des Lachens !!"

Mail    : maikweber@gmx.de
Homepage: http://www.webis-world.de (Schau doch mal vorbei !)
ICQ     : #57313947 


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


Re: How to change the encoding before parsing an XML fragment

Posted by Andy Clark <an...@apache.org>.
Han Ming Ong wrote:
>         I have searched the Xerces FAQ and read the document but am
> wondering if there is a way I specify the encoding of an XML fragment
> before the Xerces parser does its job? The usual way is of course to
> specify the encoding the XML declaration of a proper XML document but
> I'm constrained by the fact that I only have a XML fragment.

It seems like an entity resolver is what you need. If you know
the encoding then your entity resolver can return an InputSource
with a character Reader instead of a byte InputStream. (I'd also
suggest explicitly setting the encoding on the InputSource before
you return it.)

-- 
Andy Clark * IBM, TRL - Japan * andyc@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


How to change the encoding before parsing an XML fragment

Posted by Han Ming Ong <ha...@chirpyfish.org>.
Hi there!
	I have searched the Xerces FAQ and read the document but am 
wondering if there is a way I specify the encoding of an XML fragment 
before the Xerces parser does its job? The usual way is of course to 
specify the encoding the XML declaration of a proper XML document but 
I'm constrained by the fact that I only have a XML fragment.

	Anyone?

Thanks in advance!

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: schemaLocation

Posted by Elena Litani <el...@ca.ibm.com>.
Maik,

> can somebody tell me where you can use the attributes "schemaLocation" and
> "noNamespaceSchemaLocation"? Do you only can use it in the rootelement or also
> anywhere in the document? I have already look for this in the
> w3c-definitions, but didn't find anything.

XML Schema allows to use those attributes on any element with the
following restriction: "..However, it is an error if such an attribute
occurs after the first appearance of an element or attribute information
item within an element information item initially ·validated· whose
[namespace name] it addresses.. "

See the specs: http://www.w3.org/TR/xmlschema-1/#schema-loc. [point 4]

Elena

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org