|
[XML-DEV Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
RE: converting 1-20 GB xml to xsd, visualizing on webpage
- From: "Michael Kay" <mike@s...>
- To: <cheekai@s...>
- Date: Tue, 21 Oct 2008 17:03:05 +0100

On streaming mechanism, I find it rather bold that
when the DTD generator sees PQR, it assumes (P|Q|R)* right away and
forgets about PQR (as it needs to conserve memory), then hoping in future to
find RQP, PRQ, RPQ, QPR & QRP. In the instance under discussion, the
DTD generator finds RQP and happily lives with the decision of (P|Q|R)* ever
after. Can't say it is right or wrong as it is a means of helping the user
identify potential pattern, which might just be the right pattern after
all. Still, I find it rather bold...
You're overlooking the question of how users design
schemas. If you find two or three instances containing the same elements in
different orderings, then there's a very good chance that the user intention was
to allow the elements to appear in any order. We're not just trying to detect
the pattern in the sense of a regular expression, we're trying to detect the
user design pattern.
If there are six child elements, with 720 possible
orderings, and you find that 187 of those orderings are actually used in a
particular document, then a schema that allows precisely those 187 orderings and
no others would be the last thing the user wants from the tool. It's all an
exercise in extrapolation.
What the Saxon DTDGenerator does is to gradually refine its
pattern. For example, given a sequence of instances
PQR, PQQR, PR, PRR, QRP, QPRS
its sequence of best guesses will be
PQR, PQ+R, PQ*R, PQ*R+, (P|Q|R)*,
(P|Q|R|S)*
Now, you could argue that (P|Q|R)*S is a "better" pattern,
but I would say that it's excessively bold to assume that because the only
appearance of S in your sample is at the end, that every appearance will be at
the end.
Michael Kay
http://www.saxonica.com/
|

[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
| RSS 2.0 |
 |
| Atom 0.3 |
 |
| |
Stylus Studio has published XML-DEV in RSS and ATOM formats,
enabling users to easily subcribe to the list from their preferred news reader application.
|
Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website.
they were not included by the author in the initial post. To view the content without the Sponsor Links please
click here.
|
|