[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [ubl-dev] infinite loop
Them's fightin' words, David! I wouldn't want Elisa to be left with the wrong impression. Recursion is often optimal in XML design, and UBL's use of it reflects the nature of the business objects needed in UBL. Many real world relationships are recursive in nature and not contrived at all. As Mark says, the only "bad" recursive design is that without an escape of having the recursive reference optional. Elisa, please understand that when using a tool that infinitely traverses a construction whose recursive members are optional, the problem is with the tool and not the information design. *Never* ignore a recursive reference because it is likely to be very important. *Often* a recursive reference is more efficient and more natural than contriving an arbitrary number of levels of depth, only to find you haven't created enough for a particular user's requirement. I recall the old adage "any piece of string cut to length will be too short". Think of document design: in HTML you have H1 through H6 for headings of different depths of your information, but what if you need a seventh level of depth? You are stuck because the HTML designers made the arbitrary decision to stop at six levels of depth. What is so special about six? Whereas in DocBook the SECTION element recursively and optionally references the SECTION element so as to allow you to have an arbitrary depth to your information. I think the UBL choice of recursive constructs is meaningful, efficient, optimal, very appropriate, and not at all contrived. You just need to use an XML-aware tool that understands how to work properly with recursive constructs. I hope this helps. . . . . . . . . . . Ken At 2010-06-25 07:22 -0700, David RR Webber \(XML\) wrote: >Elisa, > >I concur. > >Unfortunately these loops occur in many many places in UBL - and so >you will have to find Schema tools that detect and ignore them. > >While conceptually in theory in modelling world it is possible to >have these - and a convenience for modellers - in real world actual >cases - uses tend to feel contrived. > >And for those few cases - there are better ways of handling them >than using recursion to do it. > >Trying to use your model view as the information exchange view >produces XML exchanges that do not necessarily reflect the optimal XML pattern. > >Thanks, DW > >-------- Original Message -------- >Subject: [ubl-dev] infinite loop >From: elisa blasi <<mailto://elisablasi@gmail.com>elisablasi@gmail.com> >Date: Fri, June 25, 2010 3:53 am >To: <mailto://ubl-dev@lists.oasis-open.org>ubl-dev@lists.oasis-open.org >Hi, >I' m working on UBL xsd files to obtain a tree viewer of the >documents,but the algorithm enter into an infinite loop because of >the structure of the xsd. >For example, in the Order document there is the element "Signature" >of type: Signature type. Signature type,that is a complex type, >contains the element "SignatoryParty" of type PartyType. PartyType, >that is a complexType, contains AgentParty that is a PartyType and >will contain another AgentParty element...and so on. >Is it true? I don't understand the meaning of these circular calls. >Regards Elisa -- XSLT/XQuery training: after http://XMLPrague.cz 2011-03-28/04-01 Vote for your XML training: http://www.CraneSoftwrights.com/u/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/u/ G. Ken Holman mailto:gkholman@CraneSoftwrights.com Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/u/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]