Title: RE: message output if elements/attributes don't exist

Hello,

Shane wrote:
> [..] makes me think you might want to 'think outside the box' and consider
> approaching it from another direction.

Uh, I can explain that ;-)

> [..] why
> not just write a schema or DTD and tell the parser to validate the xml
> doc before it's processed?

I can't do that. My source document isn't a normal XML document. I've build a facade capsulating a very large object hierachy. This bean implements the org.w3c.dom interfaces, so that all objects can be queried using XSLT.

The problem is that there exist about 300 classes and the classes often change (properties are adde, removed or renamed, even classes are added, removed or renamed). A whole team is working on that classes. Since my XML document reflects the object model and since this is very mutable, I can't define a stable DTD. That's why I need a mechanism to output if an element or attribute is selected by an XPATH _expression_ or somehow and it doesn't exists. In my case, usually, the object model has changed and the developer changing the nested class didn't informed me... (or I made a typo in my XSLT ;-) ).

I really don't want to add test methods everywhere in the XSLT just to recognize these effect - it's too much work!
 
> If you want some code that exercises part of the tracing API's in
> Xalan, you can look at
> xml-xalan/test/java/src/org/apache/qetest/xalanj2 for
> TraceListenerTest
> and TransformStateAPITest/TransformStateTest, which are a
> couple of the
> available test scripts for the tracing functionality.  Note that they
> are not necessarily documented for end-users, and they do *not*
> necessarily represent the best way to use tracing (since they may
> occasionally have negative tests in there).
>

Thank you!

Jens

Reply via email to