Re: Is there an elegant way to copy a DOCTYPE declaration fr
Jonathan Borden wrote: > What you are doing in your article and what I am doing in XSet is creating > an XML expansion of the XML data model which itself fits into the XPath data > model. XSet expands the entire XML property set into a set of elements and > attributes, including things like PEs, GEs, internal and external subsets, > whitespace, delimiters etc, etc, etc etc. > > A good reason this is useful is for this exact case: to allow XPath, and > hence XSLT to operate on information which is otherwise lost. I'm not sure I understand how these schemas deal with entities. Part of the idea of XML is that your document can be split among multiple entities. Does the metadocument that conforms to your schema represent the complete document, the complete set of entities, or just the document entity? It seems like there are a number of decisions to be made about how to integrate data about a multi-entity document with the complete document's XPath tree. For example, the simple XPath tree represented in ASCII art... root |__element 'myData' |__text '\n ' |__element 'foo' | |__text 'Hello World' |__text '\n ' |__element 'bar' | |__text 'Hello World' |__text '\n' ...might actually be produced by the following set of entities: <?xml version="1.0" encoding="utf-8" standalone="no"?> <!-- doc.xml, the document entity --> <!DOCTYPE myData [ <!ENTITY moreDeclarations SYSTEM "dtd2.dtd"> ] SYSTEM "dtd1.dtd"> <myData> <foo>&stuff;</foo> &morestuff; </myData> <?xml version="1.0" encoding="utf-16"?> <!-- dtd.dtd --> <!ELEMENT myData (foo*,bar*)> <!ELEMENT foo (#PCDATA)> <?xml version="1.0" encoding="iso-8859-1"?> <!-- dtd2.dtd --> <!ENTITY stuff "Hello World"> <!ENTITY morestuff SYSTEM "bar.xml"> <?xml version="1.0" encoding="utf-16"?> <!-- bar.xml --> <bar>&stuff;</bar> Even if you combine these into a single metadocument, is your XPath tree going to be a representation of the metadocument's document element and its contents, or is it going to be the simple tree above, plus some other info available through functions? Conceptually I think one of the tenets of XML is to 'physically' model an abstract tree of data. What you're doing is making an abstract tree of data that models a document that in turn models a document (or entity set) that is modeling an abstract tree of data. *boggle* I really don't like the idea of having to write a stylesheet that operates on an XPath tree that is not analogous to the tree represented by the complete, original document. - Mike ____________________________________________________________________ Mike J. Brown, software engineer at My XML/XSL resources: webb.net in Denver, Colorado, USA http://www.skew.org/xml/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format