[oXygen-user] Re: [dita-users] All possible Xpath generator?

Wendell Piez
Thu Feb 14 11:13:21 CST 2008


Hedley,

Unfortunately the list of "all possible XPaths to a text file" is 
infinite in many cases, due to the possibility of recursive 
structures such as nested div or section elements, lists inside 
lists, or inline elements that may have arbitrary inline elements in 
their content.

Do you really want a path such as 
"/doc/body/div/div/div/div/list/item/list/item/list/item/p/figure/caption/p/b/i/mono/i/b" 
even such a path points to an element that could be valid?

I think Dan is right that the requirement needs some refinement.

Cheers,
Wendell

At 08:42 PM 2/12/2008, you wrote:
>Dan:
>
>>At Wednesday, 13/02/2008, 12:16 PM;, Dan wrote:
>>your post is a bit confusing, and some better details/explanations
>>would be nice to see.  What do you mean by "write a list of all
>>possible absolute Xpaths to a text file."
>
>Rephrasing my original request:
>I am developing a CSS implementation for [instance documents that 
>conform to] an XML schema. It would really help to check if all 
>[required CSS class matches] have been covered if I could find a 
>utility that would scan a DTD (including *.mod inclusions) or XML 
>Schema to write a list of all absolute -- not including wildcards -- 
>[Xpaths from the root element to each possible leaf element] ... to 
>a text file. For example, using a possible path from a DITA DTD:
>
>         /reference/refbody/section/p
>
>This would help determine what class definitions can be generic 
>no  matter in what context an element apppears (e.g. <i>) and what 
>may  need different treatment depending on context 
>(e.g.  */section/title). Oh, and if the generator could list the 
>Xpath in  reverse, from leaf node to root, as well that would be pleasant:
>
>         p\section\refbody\reference\
>
>Then I could sort the list of paths so that all instances where <p> 
>was a leaf would be together and I could decide which contexts could 
>share a CSS class and which would need context-specific classes.
>
>I've tried using the <oXygen/> instance generator on the DITA 
>task.xsd, but even limiting recursion depth and number of 
>repetitions, it produces very large files, possibly not completing 
>in my lifetime.  And then there is the problem of extracting the Xpaths.
>
>Hope that makes it clearer,
>Hedley
>
>
>--
>Hedley Stewart Finger
>28 Regent Street   Camberwell VIC 3124   Australia
>Tel. +61 3 9809 1229   Mobile +61 412 461 558,
>E-mail <mailto:>
>
>
>_______________________________________________
>oXygen-user mailing list
>
>http://www.oxygenxml.com/mailman/listinfo/oxygen-user


======================================================================
Wendell Piez                            mailto:
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================




More information about the oXygen-user mailing list