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: VS: [ubl-dev] Namespace prefixes


Thank you Ken and Stephen,

I got the answers I needed. I sent you private responses.

I also want to thank Ken for his experimental customization tool: http://lists.oasis-open.org/archives/ubl-dev/200612/msg00002.html
Last week I downloaded the latest version. Installation was straightforward and I have already found it useful.

Regards,

Juha Ikävalko 

-----Alkuperäinen viesti-----
Lähettäjä: G. Ken Holman [mailto:gkholman@CraneSoftwrights.com] 
Lähetetty: 29. joulukuuta 2006 16:58
Vastaanottaja: ubl-dev@lists.oasis-open.org
Aihe: Re: [ubl-dev] Namespace prefixes

It is difficult to add to Steven's excellent 
response but I want to highlight a couple of things.

At 2006-12-29 14:13 +0200, Juha Ikävalko wrote:
>I got a question regarding namespaces. In all 
>XML examples namespace prefixes (e.g. 
>xmlns:cac="...") are defined in a root element.

Merely as a convenience.

>However, is't ok if these definitions are given in each element:
>
><Order xmlns="...">
>   <cbc:ID xmlns:cbc="..."></cbc:ID>
>   <cbc:IssueDate xmlns:cbc="..."></cbc:IssueDate>
>   <cac:BuyerCustomerParty xmlns:cac="..."></cac:BuyerCustomerParty>
>  ...
></Order>

Indeed this is acceptable.

>Of course, it's rational to to define namespaces 
>only in a root element but some systems seems to 
>output XML with namespaces defined in each 
>element. At first, I thought that this is just a 
>waste of bytes, but recently I got feedback that 
>it might produce some extra work for message 
>convertions if prefixes can be defined either in 
>a root element or separately in each element.

Such message conversions are probably not based 
on XML.  I agree with Steven that it is 
unacceptable to ignore the way XML works.

I would guess such conversions would probably 
choke on sally:IssueDate and 
harry:BuyerCustomerParty even though these might very well be acceptable.

Consider that there are two different UBL 
elements named {aggregate}:Location and 
{basic}:Location, which might be cac:Location and 
cbc:Location, but might also be sally:Location 
and harry:Location with the appropriate namespace declarations.

>I didn't find any recommendations or rules 
>regarding this issue from NDR. Is it possible to 
>add a recommendation that namespace prefixes 
>should be defined only in a root element?

I would not support such a recommendation as it 
would invalidate otherwise totally acceptable XML 
instances according to the base requirements of the XML Recommendation.

This might bring up in the reader's mind the 
question of why we bother with *any* instance 
rules as we do in section 6 of the spec:

   http://docs.oasis-open.org/ubl/os-UBL-2.0/UBL-2.0.html#CONSTRAINTS

For a while in my own mind I wondered about the 
appropriateness of IND3 which requires the 
character set to be UTF-8.  Personally, I do a 
lot of work in Latin 1 or US-ASCII because I type 
a lot of my work and I can't type UTF-8 well for 
"high-bit" characters.  Then it came to mind that 
the support of alternative character sets in the 
XML Declaration is *optional* and XML-conformant 
processors need not support any character set other than UTF-8 or UTF-16:

   http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Char

So, mandating that an instance be in UTF-8 means 
*all* XML processors will accept a UBL 
instance.  Allowing non-UTF-8 encoding would 
create a UBL instance that a conforming XML 
processor might not be able to accept.

So to me that is an acceptable instance 
constraint because it avoids taking advantage of an optional feature.

Which brings me around to this issue.  Supporting 
valid namespace declarations is not an optional 
feature.  Namespace-aware XML processors are 
obliged to properly process all namespace 
declarations, so adding this as an instance 
constraint is inappropriate.  Just as mandating 
the actual namespace prefixes in use is inappropriate.

I hope this is considered helpful.

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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: ubl-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: ubl-dev-help@lists.oasis-open.org



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