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

Re: DTD to XPath

  • From: Steve DeRose <Steven_DeRose@b...>
  • To: XML Dev <xml-dev@x...>
  • Date: Wed, 24 May 2000 09:25:42 -0400

xpath dtd
At 10:26 PM -0400 5/23/00, Marcus Carr wrote:
>Hi all,
>
>I seem to recall seeing an announcement for something that would take a
>DTD as input and produce XPath addresses for every element - can anyone
>provide a pointer? Thanks,

If I'm understanding your question right, such a thing is not possible,
because a DTD contains no element instances, only declarations of element
*types*; and XPath intentionally does not provide a way to point to such
declarations. Since a DTD is not itself properly an XML document, XPath has
no access to its internals. Once XML Schema is complete, of course you will
be able to point to declarations because they are themselves expressed as
elements within XML documents (namely, the schemas).

If you perhaps instead mean that you want something to produce, for each
element type declared in a DTD, the XPath expression that will refer to all
instances of that element type, then it is possible but also trivial: for
each element type name declared, write out the element type name with "//"
in front....

This should take at most 3 lines on top of anything that can parse DTDs. Or
you can get quite close with a one-line Perl script that grabs tokens that
follow "<!ELEMENT ".  I wouldn't recommend paying a lot for software to do
that.....

Steven_DeRose@B...; http://www.stg.brown.edu/~sjd



***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************

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.