[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xvif: not for schemas only


ant pipe
Another frequent comment shows that I haven't been explicit enough in the "genericity" of xvif.

My implementation is currently working only within Relax NG schemas but that's mainly because I wanted to validate it in this context where I wanted to be sure I wasn't breaking anything.

OTH, xvif defines 3 elements (if:pipe, if:transform and if:validate) which have a highly generic semantic:

 -if:pipe is a container
 -if:transform is a transformation
 -if:validate is a validation and raises an exception in case of invalidity

There is no reason why they couldn't be used in other contexts, for instance in a XSLT transformation:


<xsl:pattern match="foo">
 <if:pipe>
  <if:transform type="http://simonstl.com/ns/fragments/">
   <if:apply>
    <fragmentRules xmlns="http://simonstl.com/ns/fragments/">
     <fragmentRule pattern="," split="true" skipFirst="false"
                    repeat="true">
      <applyTo>
       <element localName="foo"/>
      </applyTo>
      <produce>
       <element localName="item"/>
      </produce>
     </fragmentRule>
    </fragmentRules>
   </if:apply>
  </if:transform>
  <if:validate type="http://relaxng.org/ns/structure/1.0>
   <oneOrMore xmlns="http://relaxng.org/ns/structure/1.0" name="foo">
    <element name="item">
     <choice>
      <value>foo</value>
      <value>bar</value>
     </choice>
    </element>
   </oneOrMore>
  </if:validate>
  <xsl:apply-templates/>
 </if:pipe>
</xsl:template>

The XSLT template above would be applying a pipe on the context node ("foo") consisting of:

1) A regular fragmentation to split a comma separated list into a list of item elements.
2) A Relax NG validation on the result
3) And apply the templates on the children elements of the result of the regular fragmentation.

Xvif is also generic enough to be embedded into applications handling full documents. The same kind of integration could be attempted within let's say Ant and a if:pipe seen as an Ant task.

Eric

PS: to subscribe to xmlschemata@x..., please send an email
with "subscribe" in the title or body to
xmlschemata-request@x... .
-- 
See you in San Diego.
                               http://conferences.oreillynet.com/os2002/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
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.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.