OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] Schema, BNF and parsing

[ Lists Home | Date Index | Thread Index ]

Andrew Jeavons wrote:
>> From your description I'd guess that every verb/attribute combination
>> and interaction has been hardcoded.  If so, you might get the best
>> bang for your buck by "acquiring" (training/hiring) someone who can
>> help you re-write your existing XSLT.
> Exactly. Which is totally brain dead. That's what set me on my search 
> for the BNF tool. Even with my minimal XSLT knowledge seeing the SAME code
> over and over again made me very worried.....
> The XSLT was done by external contractors, soon to be ex-contractors now 
> if I can help it. I know that I can make a parser out of Bison and Flex 
> with a fifth or less code
> which will do far more than the XSLT does and be readable (well to me 
> anyway....)

That's what you think you know, but it isn't correct in general. BNF can 
only do a surface syntax scan; you'll have to escape to a programming 
language to do any sort of semantic check. XSLT is far more powerful. 
That's not saying that the contractors' stylesheet actually uses any of 
this power, but it's there.

Plus, you seem to be missing this major point: Before you can teach your 
BNF to parse your XML application language, you first have to teach it 
to parse XML. This is a much bigger PITA than you imagine. The virtue of 
using existing schema languages is that they already know how to deal 
with the ins and outs of XML syntax, so you write grammars and rules at 
a much higher level than BNF.

As a parser-aware person, you should find RELAX NG compact syntax easy 
to understand and able to express what you need. If there is something 
you can't say, you can add Schematron assertions to the same schema. I'd 
strongly recommend you check it out.

Bob Foster


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS