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 Daniel Barclay <da...@fgm.com> on 2005/05/24 19:24:22 UTC

source location information available in Xerces XML Schema API?

Does Xerces' XML Schema API support getting the source location of
the XML construct that represents a given schema component (yes, only
when the XML representation is involved)?

If not, does anyone have an idea how difficult it would be to implement
that?

(My main requirement is to be able to identify which source XML schema
document entity defined a given schema component, to be able to perform
my processing on only the components defined by that document even if
Xerces needs to read multiple schema documents (via including and
importing) to have a valid schema.  I'd also like to be able to report
the line and column information for (the XML construct defining) each
schema component.)

Thanks.


Daniel





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


Re: source location information available in Xerces XML Schema API?

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Daniel Barclay <da...@fgm.com> wrote on 05/24/2005 01:24:22 PM:

> Does Xerces' XML Schema API support getting the source location of
> the XML construct that represents a given schema component (yes, only
> when the XML representation is involved)?

No, but each namespace schema information information item [1] contains a 
set (possibly empty) of the schema documents which contributed to the 
schema (for the given target namespace). In the XML Schema API this is 
represented by an unordered list of document locations [2].

> If not, does anyone have an idea how difficult it would be to implement
> that?

The source location is probably available when a component is being built 
but isn't stored since it's not a property of the component. You may be 
able to get this information from the Eclipse XSD API [3] which provides 
access to XML schema document information.
 
> (My main requirement is to be able to identify which source XML schema
> document entity defined a given schema component, to be able to perform
> my processing on only the components defined by that document even if
> Xerces needs to read multiple schema documents (via including and
> importing) to have a valid schema.  I'd also like to be able to report
> the line and column information for (the XML construct defining) each
> schema component.)
> 
> Thanks.
> 
> 
> Daniel
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-dev-help@xerces.apache.org
> 

[1] http://www.w3.org/TR/xmlschema-1/#nsi-schema_namespace
[2] 
http://www.w3.org/Submission/2004/SUBM-xmlschema-api-20040309/xml-schema-api.html#XSNamespaceItemp-documentLocations
[3] http://www.eclipse.org/xsd/

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

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