[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: dtd2xsl Program Written in OmniMark


Subject: Re: dtd2xsl Program Written in OmniMark
From: Marcus Carr <mrc@xxxxxxxxxxxxxx>
Date: Mon, 21 Aug 2000 13:44:04 +1000

Bryan Schnabel wrote:

> DTD2Xpath is would be quite useful I think.  Could you give me an idea
of
> what a good output for this would be?

You bet - a recent project involved mapping about 400 elements to form
fields in HTML via XSL. As most elements were used in only a small
number of places, it would have been much easier to do the XSL if we
could cut and paste from a list. Given the following DTD:

<!DOCTYPE a   SYSTEM "my.dtd">
<!ELEMENT a  (b, c?, d+, z)>
<!ELEMENT z  (b?, x, y)>
<!ATTLIST z  foo CDATA #IMPLIED
             bar CDATA #IMPLIED>
<!ELEMENT b  (i, j, k)>
<!-- following syntax illegally abbreviated for brevity -->
<!ELEMENT (c | d | i | j | k | x | y)  (#PCDATA)>

the output might look like:

Element       XPath
-------       -----
  a           a
  b           a/b
              a/z/b
  c           a/c
  d           a/d
  i           a/b/i
              a/z/b/i
  j           a/b/j
              a/z/b/j
  k           a/b/k
              a/z/b/k
  x           a/z/x
  y           a/z/y
  z           a/z
              a/z/@foo
              a/z/@bar

This is a simplistic example, but in a complex structure with a
resonable depth, it can look very different. If I was able to look at
all of the possible XPaths for a given element, I'd probably know which
one of the small number of cases I wanted. Otherwise, I tend to refer
back to the DTD far more often than I think I should need to.


--
Regards,

Marcus Carr                      email:  mrc@xxxxxxxxxxxxxx
___________________________________________________________________
Allette Systems (Australia)      www:    http://www.allette.com.au
___________________________________________________________________
"Everything should be made as simple as possible, but not simpler."
       - Einstein



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords