Home » Archived » XML Schema Definition (XSD) » XSDWildcard distingishing between an actual xs:any and an implied any
|
Re: XSDWildcard distingishing between an actual xs:any and an implied any [message #65608 is a reply to message #65587] |
Thu, 29 December 2005 11:17 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Francis,
No this doesn't seem right. I think there is confusion here between
elements of type anyType, i..e., <xsd:element name="x"
type=xsd:anyType"/> verses element wildcards <xsd:any>. When matching
element content using the DFA returned by XSDParticle, each element will
match either an element declaration or a wildcard, which you can tell
apart easily by whether you've matched an XSDElementDeclaration or an
XSDWildcard. In the first case, you can look at the type definition of
the element declaration and determine if it is the anyType using
XSDConstants.isURType. In the second case, depending on the processing
kind of the wildcard, it will either require a strict match to some
global element declaration, or in lax or skip mode, it will treat the
element as implicitly being of type anyType. Looking directly at the
particle or the particle's parent will not provide any useful
information in this regard since a model group can contain many wildcards.
Francis Upton wrote:
> The XSDWildcard seems to be emitted in the case where an element has
> no type information; and it is also emitted in response to an actual
> xs:any element appearing in the schema.
>
> In both cases, the XSDWildcard appears the same (surprisingly it
> refers to a DOM element from Xerces of xs:any).
>
> I'm doing an implementation where I create a tree of elements, and I
> need to distinguish these two cases. In the case of an explicit
> xs:any element appearing in a schema, I need to take a different
> action from the case where an element is simply untyped.
>
> Right now, I determine the difference by seeing if the parent of the
> enclosing particle is an XSDModelGroup which has more than one child.
> In this case, I assume I'm working with an explicit xs:any.
>
> Does this seem right? Is there a better way to go?
>
> Thanks,
>
> Francis
|
|
|
Re: XSDWildcard distingishing between an actual xs:any and an implied any [message #65629 is a reply to message #65608] |
Thu, 29 December 2005 21:00 |
Francis Upton IV Messages: 472 Registered: July 2009 Location: Oakland, CA |
Senior Member |
|
|
Thanks Ed, what you describe is exactly how I thought it should work. I
found the problem, I took a left turn in my code which did not allow
me to see what was really going on.
Happy new year to you!
Francis
Ed Merks wrote:
> Francis,
>
> No this doesn't seem right. I think there is confusion here between
> elements of type anyType, i..e., <xsd:element name="x"
> type=xsd:anyType"/> verses element wildcards <xsd:any>. When matching
> element content using the DFA returned by XSDParticle, each element will
> match either an element declaration or a wildcard, which you can tell
> apart easily by whether you've matched an XSDElementDeclaration or an
> XSDWildcard. In the first case, you can look at the type definition of
> the element declaration and determine if it is the anyType using
> XSDConstants.isURType. In the second case, depending on the processing
> kind of the wildcard, it will either require a strict match to some
> global element declaration, or in lax or skip mode, it will treat the
> element as implicitly being of type anyType. Looking directly at the
> particle or the particle's parent will not provide any useful
> information in this regard since a model group can contain many wildcards.
>
>
> Francis Upton wrote:
>
>> The XSDWildcard seems to be emitted in the case where an element has
>> no type information; and it is also emitted in response to an actual
>> xs:any element appearing in the schema.
>>
>> In both cases, the XSDWildcard appears the same (surprisingly it
>> refers to a DOM element from Xerces of xs:any).
>>
>> I'm doing an implementation where I create a tree of elements, and I
>> need to distinguish these two cases. In the case of an explicit
>> xs:any element appearing in a schema, I need to take a different
>> action from the case where an element is simply untyped.
>>
>> Right now, I determine the difference by seeing if the parent of the
>> enclosing particle is an XSDModelGroup which has more than one child.
>> In this case, I assume I'm working with an explicit xs:any.
>>
>> Does this seem right? Is there a better way to go?
>>
>> Thanks,
>>
>> Francis
>
Platform UI Committer for Common Navigator
http://wiki.eclipse.org/index.php/Common_Navigator_Framework
http://help.eclipse.org/galileo/topic/org.eclipse.platform.d oc.isv/guide/cnf.htm
|
|
|
Re: XSDWildcard distingishing between an actual xs:any and an implied any [message #597412 is a reply to message #65587] |
Thu, 29 December 2005 11:17 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Francis,
No this doesn't seem right. I think there is confusion here between
elements of type anyType, i..e., <xsd:element name="x"
type=xsd:anyType"/> verses element wildcards <xsd:any>. When matching
element content using the DFA returned by XSDParticle, each element will
match either an element declaration or a wildcard, which you can tell
apart easily by whether you've matched an XSDElementDeclaration or an
XSDWildcard. In the first case, you can look at the type definition of
the element declaration and determine if it is the anyType using
XSDConstants.isURType. In the second case, depending on the processing
kind of the wildcard, it will either require a strict match to some
global element declaration, or in lax or skip mode, it will treat the
element as implicitly being of type anyType. Looking directly at the
particle or the particle's parent will not provide any useful
information in this regard since a model group can contain many wildcards.
Francis Upton wrote:
> The XSDWildcard seems to be emitted in the case where an element has
> no type information; and it is also emitted in response to an actual
> xs:any element appearing in the schema.
>
> In both cases, the XSDWildcard appears the same (surprisingly it
> refers to a DOM element from Xerces of xs:any).
>
> I'm doing an implementation where I create a tree of elements, and I
> need to distinguish these two cases. In the case of an explicit
> xs:any element appearing in a schema, I need to take a different
> action from the case where an element is simply untyped.
>
> Right now, I determine the difference by seeing if the parent of the
> enclosing particle is an XSDModelGroup which has more than one child.
> In this case, I assume I'm working with an explicit xs:any.
>
> Does this seem right? Is there a better way to go?
>
> Thanks,
>
> Francis
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: XSDWildcard distingishing between an actual xs:any and an implied any [message #597419 is a reply to message #65608] |
Thu, 29 December 2005 21:00 |
Francis Upton IV Messages: 472 Registered: July 2009 Location: Oakland, CA |
Senior Member |
|
|
Thanks Ed, what you describe is exactly how I thought it should work. I
found the problem, I took a left turn in my code which did not allow
me to see what was really going on.
Happy new year to you!
Francis
Ed Merks wrote:
> Francis,
>
> No this doesn't seem right. I think there is confusion here between
> elements of type anyType, i..e., <xsd:element name="x"
> type=xsd:anyType"/> verses element wildcards <xsd:any>. When matching
> element content using the DFA returned by XSDParticle, each element will
> match either an element declaration or a wildcard, which you can tell
> apart easily by whether you've matched an XSDElementDeclaration or an
> XSDWildcard. In the first case, you can look at the type definition of
> the element declaration and determine if it is the anyType using
> XSDConstants.isURType. In the second case, depending on the processing
> kind of the wildcard, it will either require a strict match to some
> global element declaration, or in lax or skip mode, it will treat the
> element as implicitly being of type anyType. Looking directly at the
> particle or the particle's parent will not provide any useful
> information in this regard since a model group can contain many wildcards.
>
>
> Francis Upton wrote:
>
>> The XSDWildcard seems to be emitted in the case where an element has
>> no type information; and it is also emitted in response to an actual
>> xs:any element appearing in the schema.
>>
>> In both cases, the XSDWildcard appears the same (surprisingly it
>> refers to a DOM element from Xerces of xs:any).
>>
>> I'm doing an implementation where I create a tree of elements, and I
>> need to distinguish these two cases. In the case of an explicit
>> xs:any element appearing in a schema, I need to take a different
>> action from the case where an element is simply untyped.
>>
>> Right now, I determine the difference by seeing if the parent of the
>> enclosing particle is an XSDModelGroup which has more than one child.
>> In this case, I assume I'm working with an explicit xs:any.
>>
>> Does this seem right? Is there a better way to go?
>>
>> Thanks,
>>
>> Francis
>
Platform UI Committer for Common Navigator
http://wiki.eclipse.org/index.php/Common_Navigator_Framework
http://help.eclipse.org/galileo/topic/org.eclipse.platform.d oc.isv/guide/cnf.htm
|
|
|
Goto Forum:
Current Time: Thu Sep 26 00:44:37 GMT 2024
Powered by FUDForum. Page generated in 0.04356 seconds
|