You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Lingzhi Zhang <lz...@gmail.com> on 2005/04/29 01:24:44 UTC

retrieve non-schema namespace attribute

Hi,

I have a schema which uses the non-schema namespace attributes in both
element and attribute declaration. I am now want to use PSVI to get
these information when the data is parsed. However, from the xerces
doc, I couldn't figure out how to get these information.

How to get the non-schema namespace attribute using PSVI in xerces?
Does xerces have already implemented this?

Thanks.

Steve

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


Dangling references error or not?

Posted by Bob Foster <bo...@objfac.com>.
The following exchange took place on xml-dev yesterday. I am the guilty 
party who invoked XercesJ. In fairness to Henry, I want to know if I 
somehow turned on the reportErrorsThatArentReallyErrors switch.

------------------------------------
Hmm. XercesJ reports three errors (not warnings) from this schema of the 
form:

Error - src-resolve: Cannot resolve the name 'unknownX' to a(n) 'type 
definition' component.

Where X is one of: 1, 2, 3;

Bob Foster

Henry S. Thompson wrote:
 > I'll answer a simple question which I understand, and which I _think_
 > is what you're asking.
 >
 > The following XML document is valid:
 >
 > <!DOCTYPE root [
 > <!ELEMENT root (a|x)>
 > <!ELEMENT a (b|y)>
 > <!ELEMENT b (c|z)>
 > <!ELEMENT c EMPTY>
 > ]>
 > <root><a><b><c/></b></a></root>
 >
 > Note it contains no declarations for the elements x, y and z.
 >
 > The corresponding schema document successfully validates the same
 > instance:
 > [Example unquoted so you can try it yourself]

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="root">
   <xs:complexType>
    <xs:choice>
     <xs:element ref="a"/>
     <xs:element ref="x"/>
    </xs:choice>
   </xs:complexType>
  </xs:element>

  <xs:element name="a">
   <xs:complexType>
    <xs:choice>
     <xs:element ref="b"/>
     <xs:element ref="y"/>
    </xs:choice>
   </xs:complexType>
  </xs:element>

  <xs:element name="b">
   <xs:complexType>
    <xs:choice>
     <xs:element ref="c"/>
     <xs:element ref="z"/>
    </xs:choice>
   </xs:complexType>
  </xs:element>

  <xs:element name="c">
   <xs:complexType/>
  </xs:element>

  <xs:element name="x" type="unknown1"/>
  <xs:element name="y" type="unknown2"/>
  <xs:element name="z" type="unknown3"/>
</xs:schema>

 >
 > So yes, you can do incremental development of a schema for a complex
 > XML language.
 >
 > ht


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


Re: retrieve non-schema namespace attribute

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Steve,

If your element and attribute declarations have annotations [1] the 
non-schema namespace attributes will be accessible from the XSAnnotation 
[2] associated with those declarations. If they don't have annotations 
then with Xerces 2.6.2 you're out of luck, however we recently added a new 
feature (http://apache.org/xml/features/generate-synthetic-annotations) in 
CVS which when enabled will generate a synthetic annotation when a schema 
component has non-schema attributes but no child annotation. This support 
will be available in Xerces 2.7.0.

[1] http://www.w3.org/TR/xmlschema-1/#cAnnotations
[2] 
http://www.w3.org/Submission/2004/SUBM-xmlschema-api-20040309/xml-schema-api.html#Interface-XSAnnotation

Lingzhi Zhang <lz...@gmail.com> wrote on 04/28/2005 07:24:44 PM:

> Hi,
> 
> I have a schema which uses the non-schema namespace attributes in both
> element and attribute declaration. I am now want to use PSVI to get
> these information when the data is parsed. However, from the xerces
> doc, I couldn't figure out how to get these information.
> 
> How to get the non-schema namespace attribute using PSVI in xerces?
> Does xerces have already implemented this?
> 
> Thanks.
> 
> Steve
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org
> 

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


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