 |
 |
 |
On 5 Feb, 19:33, GendoIkari <crawfor...@gmail.com> wrote:
> I've been going nuts all day trying to figure this out... I need to
> create a schema that allows the document to have an element with any
> possible name. When using the <xs:any> tag, it still will only allow
> any element that is defined in my namespace. I need to allow elements
> which are not defined in any namespace. I've added namespace="##local"
> but that still doesn't work, because in the instance document the
> element in question is still part of the namespace. The only way at
> all I've gotten something to work is by adding processContents="lax",
> but this is not good because then I can't ensure that the element is
> the correct structure. I need the element to be a simple type, an
> xs:string. It should not be allowed to have child nodes. Is there any
> way I can force the document to be this specific structure, but NOT
> enforce a specific element name to be used?
>
> Thanks,
>
> -Robert
I'd be interested to know why you want to do this. There might be a
better way to tackle the problem. For example, and XML instance along
the lines of <data name="foo" value="bar"/> might work.
Coming back to the problem as ou stated, if you do
processContents="strict" then you will have to have a definition of
the element somewhere for validation to complete. This would be the
only way you could restrict the type of the element as well. With
that in mind, you might be able to define an xs:group that defines all
your possible extra elements.
BTW - when using xs:any to allow elements in your existing namespace,
you have to worry about the Unique Particle Attribution Constraint, or
UPAC. Annoyingly, if you have an element prior to your xs:any that
does not have fixed cardinality (i.e. minOccurs and maxOccurs are not
the same value) then the xs:any will be in conflict with that element
and the schema won't be valid!
Other than that, can you not do namespace="##any" on your xs:any
statement?
HTH,
Pete Cordell
Codalogic
Visit http://www.codalogic.com/lmx/ for XML C++ data binding
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |