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

 


Help: OASIS Mailing Lists Help | MarkMail Help

ubl-hisc message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [ubl-hisc] SBS and input specs


At 2005-02-22 08:40 -0500, I wrote:
>At 2005-02-21 19:52 -0700, Micah Dubinko wrote:
>>Where can I find machine-readable (and transformable!) specs for SBS?
>...
>>Ideally, I'd like to see something like: (glossing over ns declarations, 
>>but you get the idea)
>>
>><sbs for="Order" version="1.0">
>>  <xpath>order:Order/cbc:IssueDate</xpath>
>>  <xpath>order:Order/cbc:Note</xpath>
>>  ...
>></sbs>
>
>You get everything, including ns declarations, in "Order.xml" in that ZIP 
>file.

An example is below ... but I think it would be best if you could identify 
the features you would need in the XPath XML file to do your work directly 
from it, so that all the information is in the one place.

I hope this helps.

..................... Ken

T:\xpaths>dir order.*
  Volume in drive T is Crane Data
  Volume Serial Number is 0445-7502

  Directory of T:\xpaths

2005-01-25  08:38           117,451 Order.htm
2005-01-25  08:38            32,356 Order.txt
2005-01-25  08:38            21,404 Order.xml
                3 File(s)        171,211 bytes
                0 Dir(s)  12,661,026,816 bytes free

T:\xpaths>type micah.xsl
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                 version="1.0">

<xsl:output indent="yes"/>

<xsl:template match="/">
   <sbs for="{name(/*)}">
     <xsl:apply-templates select="*"/>
   </sbs>
</xsl:template>

<xsl:template match="*|@*">
   <xpath>
     <xsl:for-each select="ancestor-or-self::*">
       <xsl:text/>/<xsl:value-of select="name(.)"/>
     </xsl:for-each>
     <xsl:if test="not(self::*)">
       <xsl:text/>/@<xsl:value-of select="name(.)"/>
     </xsl:if>
   </xpath>
   <xsl:apply-templates select="*|@*"/>
</xsl:template>

</xsl:stylesheet>
T:\xpaths>saxon -o sbs.xml Order.xml micah.xsl

T:\xpaths>head sbs.xml
<?xml version="1.0" encoding="utf-8"?>
<sbs for="po:Order">
    <xpath>/po:Order</xpath>
    <xpath>/po:Order/po:BuyersID</xpath>
    <xpath>/po:Order/po:BuyersID/@identificationSchemeAgencyID</xpath>
    <xpath>/po:Order/po:BuyersID/@identificationSchemeAgencyName</xpath>
    <xpath>/po:Order/po:BuyersID/@identificationSchemeDataURI</xpath>
    <xpath>/po:Order/po:BuyersID/@identificationSchemeID</xpath>
    <xpath>/po:Order/po:BuyersID/@identificationSchemeName</xpath>
    <xpath>/po:Order/po:BuyersID/@identificationSchemeURI</xpath>

T:\xpaths>

--
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/o/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/o/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]