XPath Limitations

Some limitations of XPaths that I have encountered while working on this project:

The Ordering Problem:

Consider the following DTD fragment:

<!ELEMENT A (B*,C,B*)>

We want to display in out output file all the B elements that occur before C, then a separator of our choice, then all B elements that occur after C in the XML input file.

I am not aware of any way I could do this using XPath and XSL-Transformations

 

The Reoccurrence Problem

Consider the following DTD fragment:

<!ELEMENT Root (A, D)>

<!ELEMENT A (B, C)>

<!ELEMENT D (B, E)>

<!ELEMENT B (EMPTY)>

<!ATTLIST B value CDATA #REQUIRED >

We would like to be able to output something like:

A has a value of [.A//B@value]. D has a value of [.D//B@value]

and custom-format the value to be displayed in the same manner. The problem occurs because in XPath we would have to repeat the formatting instructions for each occurrence of B inside a new ELEMENT. So if we want to modify the formatting we will have to do that for each occurrence. Bad.

 

 

 

Copyright 1996-1999