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] XPath and XPattern (was Re: [xml-dev] More on tamingSAX)

[ Lists Home | Date Index | Thread Index ]

Alan Gutierrez wrote:

>* Jeff Rafter <lists@jeffrafter.com> [2004-12-27 14:40]:
>  
>
>>>>  Say the test was /foo/bar/[baz2="test"]/baz1
>>>>
>>>>  <foo>
>>>>    <bar>
>>>>      <baz1/>
>>>>      <baz2>test</baz2>
>>>>      <baz3/>
>>>>    </bar>
>>>>  </foo>
>>>>
>>>>  If your schema stated that the children were (baz1,baz2,baz3)
>>>>  wouldn't you have enough information to know to surrender when
>>>>  you reached baz3?
>>>>        
>>>>
>
>  
>
>>Unfortunately that solution doesn't win much against the DOM or other 
>>tree based models.
>>    
>>
>
>    It does if your predicate can fail early.
>
>  
>
>>For example if your schema asserted (as you say) that the content
>>model of bar be (baz1, baz2, baz3) and that baz2="test" always--
>>then you could "surrender" at the point of baz1 by starting with
>>the assumption of validity. If the document turns out to not be
>>valid you could raise some special error that says essentially--
>>hey we assumed this was valid and it isn't so we don't know if we
>>reported the right thing or not.
>>    
>>
>
>    Or, to simply the implementation, a valid document could be a
>    requirement, which is what I was imagining.
>  
>

Ah.  The pipelining approach.  Perfectly sensible.  Luckily most schema 
languages support validation via streaming API (Schematron is a bit of a 
problem, unless its query sublanguages are themselves restricted to our 
XPattern), so we don't run into the awkward problem that we have to tree 
up a document earlier in the pipeline for validation.

But I'd say for a first pass at XPattern we leave out Schema aids and 
maybe they could be a subject of a later "level", as long as one could 
work in ecumenical schema language support.


-- 
Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Use CSS to display XML - http://www.ibm.com/developerworks/edu/x-dw-x-xmlcss-i.html
Full XML Indexes with Gnosis - http://www.xml.com/pub/a/2004/12/08/py-xml.html
Be humble, not imperial (in design) - http://www.adtmag.com/article.asp?id=10286
UBL 1.0 - http://www-106.ibm.com/developerworks/xml/library/x-think28.html
Use Universal Feed Parser to tame RSS - http://www.ibm.com/developerworks/xml/library/x-tipufp.html
Default and error handling in XSLT lookup tables - http://www.ibm.com/developerworks/xml/library/x-tiplook.html
A survey of XML standards - http://www-106.ibm.com/developerworks/xml/library/x-stand4/
The State of Python-XML in 2004 - http://www.xml.com/pub/a/2004/10/13/py-xml.html





 

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

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