[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Applying DTDs to sub-documents

  • From: "Anthony B. Coates" <abcoates@o...>
  • To: "W3C XML Developers' List" <xml-dev@i...>
  • Date: Mon, 23 Nov 1998 00:20:14 AET

applying dtd to xml
I'm sure this must have been dealt with some time ago, so my apologies in
advance, but has anyone been applying DTDs to sub-documents, e.g. you have an
XML document (without a DTD) like

<?xml version="1.0"?>
<document>
  <head>
    <title>The Title</title>
  </head>
  <body>
    <equation dtd="equation.dtd">
      <variable>a</variable>
      <equals/>
      <variable>b</variable>
    </equation>
  </body>
</document>

and you only want to apply the DTD to a particular section, in this case the
<equation> tag and its children.  What I would really like is to have my XML
parser produce a tag stream, and then have the appropriate part of the tag
stream validated against the DTD.  However, looking at how current parsers work,
it seems more like what I would have to do is
(i) parse the document
(ii) intercept the <equation> tag and its siblings
(iii) generate an intermediate XML document from (ii)
(iv) parse the intermediate document using the DTD
which involves an extra "tags -> XML test -> tags" round-trip that I would have
preferred to avoid.

Can anyone tell me if there is a better way than what I have described above? 
I'm sure I won't be the only one wanting to do this, so some of you must already
have had much better ideas than my own.  Anyway, if anyone has any hints, I
would be very grateful for them.

	Cheers,
			Tony.

** Anthony B. Coates
** Software Engineer (Java).  This is a 100% Pure Java e-mail.
** <mailto:abcoates@o...>

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.