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

 


Help: OASIS Mailing Lists Help | MarkMail Help

ubl-dev message

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


Subject: Re: [ubl-dev] Use of UBL Data Dictionary


At 2015-03-24 19:27 +0000, William Velasquez wrote:
As far as I know, the UBL Data Dictionary is contained in the spreadsheets located at the "mod" folder of UBL Specification ZIP Package, and it contains "all" the same information about the structure of UBL documents that the XML Schemas.

In second place, the genericode files (UBL-Entities-2.1.gc) contains the same information that the spreadsheets, but using the genericode format to represent the spreadsheet rows and columns.

Yep!

Well, now I'm trying to use the information stored in the genericode files to navigate the UBL document structure and understand the parent child relationships between elements, but I can't find how to do it.

Let me show an example:

If I want to know the child elements of Order, I search for the rows with the value "UBL-Order-2.1" in the column UBLName.

Actually, UBL-Order-2.1 is in the column "ModelName". Another way is to find "Order" in the column "ObjectClass". Both ways will give you the child elements of Order. I tend to use the ObjectClass value as the ModelName value for the common library contains multiple ABIEs.

Now, you know that every element that is a parent of other elements is an ASBIE, and that the ASBIE's structure is defined by an ABIE. The task is to find each child of each ASBIE by looking at the associated ABIE definition.

Now, I want to know the child elements of one of this elements, like BuyerCustomerParty, but I can't find how to do it, neither the children of its children and so on.

"BuyerCustomerParty" is the element name, its ASBIE structure is defined by looking at the column "AssociatedObjectClass" where you find the ABIE "Customer Party". This leads you to find the children in all rows where the column "ObjectClass" is the value "Customer Party". I see there are 8 rows, so there are 8 children. The BBIE children have text children, the ASBIE children have element children, again defined by the ABIE defined by the "AssociatedObjectClass" column.

For example, the child with the "UBLName" of "Party" has the "AssociatedObjectClass" value of "Party". Looking up all rows with the "ObjectClass" column value of "Party" will find their children.

And so on.

My questions are:
-          Are my suppositions about the genericode and XML Schemas true?

Yes.

-          Am I taking the right path to find  the parent/child relationships?

Yes, with the details I've outlined above.

- Is there any documentation that explains how to find those relationships?

There is a brief discussion of walking the spreadsheets here:

http://docs.oasis-open.org/ubl/os-UBL-2.1/UBL-2.1.html#S-NAVIGATING-SPREADSHEETS

... that you then translate into using the genericode files as I have described.

Also, if you download my Crane-gc2ublndr.xsl stylesheet you can see my extensive use of keys in XSLT to track ABIEs:

<xs:key>
  <para>
    Index the genericode file for all ABIEs, using the common library model
    name as the lookup for common ABIEs, and using the ABIE name as the lookup
    for document ABIEs.
  </para>
</xs:key>
<xsl:key name="gu:abie-by-name-or-model"
         match="/*/SimpleCodeList/Row[gu:col(.,'ComponentType')='ABIE']"
         use="if( gu:col(.,'ModelName')=$gu:thisCommonLibraryModel )
              then $gu:thisCommonLibraryModel
              else gu:col(.,$gu:names)"/>

<xs:key>
  <para>
    Index the genericode file for all BBIEs.
  </para>
</xs:key>
<xsl:key name="gu:bbie-by-name"
         match="/*/SimpleCodeList/Row[gu:col(.,'ComponentType')='BBIE']"
         use="gu:col(.,$gu:names)"/>

<xs:key>
  <para>
    Index the genericode file for all ABIEs.
  </para>
</xs:key>
<xsl:key name="gu:abie-by-name"
         match="/*/SimpleCodeList/Row[gu:col(.,'ComponentType')='ABIE']"
         use="gu:col(.,$gu:names)"/>

<xs:key>
  <para>
    Index the genericode file for all business information entities by type
  </para>
</xs:key>
<xsl:key name="gu:bie-by-type" match="/*/SimpleCodeList/Row"
         use="gu:col(.,'ComponentType')"/>

<xs:key>
  <para>
    Index the genericode file for all BIEs for a given ABIE
  </para>
</xs:key>
<xsl:key name="gu:bie-by-abie"
         match="/*/SimpleCodeList/Row[gu:col(.,'ComponentType')!='ABIE']"
         use="preceding-sibling::Row[gu:col(.,'ComponentType')='ABIE'][1]/
              gu:col(.,$gu:names)"/>

<xs:key>
  <para>
    Index the genericode file for all ASBIEs for a given ABIE
  </para>
</xs:key>
<xsl:key name="gu:asbie-by-abie"
         match="/*/SimpleCodeList/Row[gu:col(.,'ComponentType')='ASBIE']"
         use="preceding-sibling::Row[gu:col(.,'ComponentType')='ABIE'][1]/
              gu:col(.,$gu:names)"/>

<xs:key>
  <para>
    Index the genericode file for all BBIEs by Data Type.
  </para>
</xs:key>
<xsl:key name="gu:bbie-by-data-type"
         match="/*/SimpleCodeList/Row[gu:col(.,'ComponentType')='BBIE']"
         use="gu:col(.,'DataType')"/>

Thinking about the use of keys makes working with the genericode file easy and quick ... quick because keys are indexed constructs.

That package is at:

  http://www.CraneSoftwrights.com/resources/ubl/#gc2ublndr

I hope this helps.

. . . . . . . . . Ken


--
Check our site for free XML, XSLT, XSL-FO and UBL developer resources |
Free 5-hour lecture:  http://www.CraneSoftwrights.com/links/video.htm |
Crane Softwrights Ltd.             http://www.CraneSoftwrights.com/u/ |
G. Ken Holman                    mailto:gkholman@CraneSoftwrights.com |
Google+ profile:       http://plus.google.com/+GKenHolman-Crane/about |
Legal business disclaimers:     http://www.CraneSoftwrights.com/legal |


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com



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