xsl-list
[Top] [All Lists]

Re: [xsl] comparing XML document structure

2011-08-17 18:44:13
On Wed, August 17, 2011 11:48 pm, Wendell Piez wrote:
It sounds like you want to infer content models on the fly and then
validate against them. I can imagine approaches to this, but I doubt
that I'd trust many algorithms that actually attempted it -- not because
of XSLT, but because of the problem specifying the problem.
...
But why not use a schema? There are processors such as Trang that can
infer schemas from documents.

What Wendell said.

...
On 8/17/2011 5:57 PM, Graydon wrote:
...
The desired goal is to be able to programmatically pull the structure,
at least to the extent of parent-child element pairs, from the
semantics-defining file, and compare that to each output file in turn.

So if the semantics-defining file gives an example section element,
which has num, para, and subsection element children, what I want to be
able to do is create a sequence of axis relationships and test the
section elements of the output for axis relationships that are not
members of that sequence.

It would help the rest of us wrap our heads around the problem if you
could provide a sample fragment of the "semantics-defining file" so we can
see what you are dealing with.

You may be able to create the tests you want in Schematron, but it's a bit
hard to tell without having an example to look at.  (If you can generate
Schematron from your definitions, you could directly create XSLT for the
axis tests about as easily, but the advantage could be that there are
tools such as XML IDEs that already understand the Schematron report
format.)

Regards,


Tony Graham                                   tgraham(_at_)mentea(_dot_)net
Consultant                                 http://www.mentea.net
Mentea       13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
 --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
    XML, XSL FO and XSLT consulting, training and programming


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--