Re: How to define a "anywhere" node in my XSD



Stefan Ram wrote:
Peter Flynn <peter.nosp@xxxxxxxxxxxxx> writes:
I would like to specify in my XSD that the "Documentation" element can
be added everywhere in the XML document. A bit like the
xs:documentation node.
Yes, this is why it's unlikely to happen. Sadly the use of XML for dealing with real-life text documents was sidelined in the mad rush
to use XML for handling data, for which it is not always suited.

I do not know XSD, but I guess that the above can already be
done today, by explicitly allowing this element for every
element (repeatedly for each element).

Oh yes (see earlier posts). The nice thing about Exceptions was that
they only had to be specified on the earliest ancestor element type,
and were then inherited to all descendants automatically. But they
are a DTD solution, not an XSD solution.

The solution, of course, is to use schema modelling software like
Relax/NG, as you imply.

///Peter

So the only problem of the OP might be that this has to be
repeated, but this can be eliminated by generating the XSD
from a program or using a preprocessor. I mean, who still
writes his XSD manually, today? (seriously; I don't know,
because I have no experience with XSD.)

One even might consider to write a tool that translates an
SGML-DTD to the best XSD-approximation, which would include
this capability.

.



Relevant Pages

  • Re: Representing Biz Entity in XML: Use XMLSerializer or custom using XSD?
    ... I guess you could say the root of our problems is trying to marrying up between a complex .NET object that implements OOP and an XML document to be used by a Web Service. ... VB) that correspond to that XSD. ... > Of course the business entity would have to do the creation and field ... XmlSerializer does this for you, ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Problem with XMLValidatingReader
    ... Your test harness code is correct. ... But your expectation from the XSD and XML ... This should not cause an error as the XML document is valid ... > Detects most schema infractions, so I'll assume this is a correct ...
    (microsoft.public.dotnet.xml)
  • Re: How to define a "anywhere" node in my XSD
    ... I would like to specify in my XSD that the "Documentation" element can ... be added everywhere in the XML document. ... How can i declare this in my XSD? ... What you are asking for is equivalent to an inclusion in SGML. ...
    (comp.text.xml)
  • Re: There must be a better way!
    ... returns the data in <QueryResponse> - I've found the XSD that goes with ... apply to the XML Document). ... Sterling International Consulting Group ...
    (microsoft.public.sqlserver.xml)