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

 


Help: OASIS Mailing Lists Help | MarkMail Help

cam message

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


Subject: RE: [cam] Default Namespaces


Hi,
	Not sure I understand the reply.  In my real life experience we
have found too many tools that find items that are namespace specific
with no prefix too difficult to handle.

	The issue is that CAM templates must NOT have default
namespaces.  The instance documents can.  This is the same rule as for
XSLT.

	Therefore you will see fro the attached bod example that I have
changed the cam template and left the instance document alone.

	I feel that this is very important as without it we would be not
fully namespace savvy.	

Martin Roberts 
xml designer, 
BT Exact
e-mail: martin.me.roberts@bt.com 
tel: +44(0) 1473 609785  clickdial
fax: +44(0) 1473 609834
Intranet Site :http://twiki.btlabs.bt.co.uk/twiki



-----Original Message-----
From: David RR Webber - XML ebusiness [mailto:Gnosis_@compuserve.com] 
Sent: 01 July 2003 17:06
To: Roberts,MME,Martin,XSG3 R
Cc: cam@lists.oasis-open.org
Subject: re: [cam] Default Namespaces


Martin,

I see the issue with a default namespace.  So we're basically saying -
we do not recommend people assigning a 
default namespace.

How about using an <as:include> to pull in that line, that way the
actual offending 
    xmlns="http://somenamespace.org/
declaration can sit outside of the XML instance, and therefore the CAM
processor will not be bothered by it - but it will get generated into
the final output?  We could add a mode to the <as:include> to indicate
if it happens  pre-parsing or post-parsing.

Thanks, DW. ======================================================= 

Message text written by INTERNET:martin.me.roberts@bt.com
> 
Hi, 
        The CAM spec needs to specify what will happen with default
namespaces. 

        In one of the samples based on the BOD two occurances of default
namespaces exist: 

        one for CAM and one within the structure.  The problem with this
is that XPATH can not handle default namespaces, ie. A namespace-uri
that has not associated prefix.  It can handle no namespace.

        This must be explained in the document as processing the
contents is not possible where the xpath expressions do not use any
prefixes if there is a default namespace uri.

Exactly.  /ApplicationArea will only match <ApplicationArea> but not
<ApplicationArea xmlns="http://somenamespace.org/
<http://somenamespace.org/> "/>

        This means that CAM templates need to be more carefully created.

<


You may leave a Technical Committee at any time by visiting
http://www.oasis-open.org/apps/org/workgroup/cam/members/leave_workgroup
.php


<!--
    CAM example of OAGIS BOD

    Using Open Applications Group XML XYZ Overlay Example
    Copyright 1998-2002, All Rights Reserved

    Name: XYZSyncParty.xml

    With permission.
-->

<!-- Example Assembly for SyncParty BOD items -->
<as:CAM xmlns:as="http://www.oasis-open.org/committees/cam" xmlns:bod="http://www.openapplications.org/oagis">
 <as:AssemblyStructure>
   <as:Header>
     <as:CAMlevel value="1"/>
     <as:Description>Example using XML structure</as:Description>
   </as:Header>

<as:Structure>
<bod:SyncParty xmlns:bod="http://www.openapplications.org/oagis" xmlns:xyz="http://www.XYZCorp.com/oagis/xyz"  revision="8.0" environment="Production" lang="en-US">
  <bod:ApplicationArea>
    <bod:Sender>
      <bod:LogicalId>%%</bod:LogicalId>
      <bod:Component>%%</bod:Component>
      <bod:Task>%%</bod:Task>
      <bod:ReferenceId>%%</bod:ReferenceId>
      <bod:Confirmation>0</bod:Confirmation>
      <bod:AuthorizationId>%%</bod:AuthorizationId>
    </bod:Sender>
    <bod:CreationDateTime as:mask='YYYY-MM-DDTHH:MM:SS-HH:MMZ'>%%</bod:CreationDateTime>
    <bod:Signature qualifyingAgency="%%"/>
    <bod:BODId>%%</bod:BODId>
    <bod:UserArea/>
  </bod:ApplicationArea>
  <bod:DataArea>
    <bod:Sync confirm="Always">
      <bod:SyncCriteria expressionLanguage="XPath">
        <bod:SyncExpression action="Add">%%</bod:SyncExpression>
      </bod:SyncCriteria>
    </bod:Sync>
    <xyz:Party active="false" oneTime="false">
      <bod:PartyId>
        <bod:Id>%%</bod:Id>
        <bod:SCAC>%%</bod:SCAC>
        <bod:DUNS>%%</bod:DUNS>
      </bod:PartyId>
      <bod:AlternatePartyIds>
        <bod:BillToPartyId>
          <bod:Id>%%</bod:Id>
          <bod:SCAC>%%</bod:SCAC>
          <bod:DUNS>%%</bod:DUNS>
          <bod:AssigningPartyId>
            <bod:Id>%%</bod:Id>
            <bod:SCAC>%%</bod:SCAC>
            <bod:DUNS>%%</bod:DUNS>
          </bod:AssigningPartyId>
        </bod:BillToPartyId>
        <bod:CustomerPartyId>
          <bod:Id>%%</bod:Id>
          <bod:SCAC>%%</bod:SCAC>
          <bod:DUNS>%%</bod:DUNS>
          <bod:AssigningPartyId>
            <bod:Id>%%</bod:Id>
            <bod:SCAC>%%</bod:SCAC>
            <bod:DUNS>%%</bod:DUNS>
          </bod:AssigningPartyId>
        </bod:CustomerPartyId>
      </bod:AlternatePartyIds>
      <bod:Name lang="en-us">%%</bod:Name>
      <bod:Business>
        <bod:Id>%%</bod:Id>
        <bod:Function>%%</bod:Function>
        <bod:Name lang="en-us">%%</bod:Name>
        <bod:RelatedUnit>
          <bod:Relationship>%%</bod:Relationship>
          <bod:Unit>
            <bod:Id>%%</bod:Id>
            <bod:Function>%%</bod:Function>
            <bod:Name lang="en-us">%%</bod:Name>
            <bod:UserArea/>
          </bod:Unit>
        </bod:RelatedUnit>
        <bod:UserArea/>
      </bod:Business>
      <bod:Currency>%%</bod:Currency>
      <bod:Description lang="en-us" owner="%%">%%</bod:Description>
      <bod:GLEntity>%%</bod:GLEntity>
      <bod:PaymentMethod>Credit Card</bod:PaymentMethod>
      <bod:Rating>Good</bod:Rating>
      <bod:TaxExemptInd>1</bod:TaxExemptInd>
      <bod:TaxId>%%</bod:TaxId>
      <bod:TermId>%%</bod:TermId>
      <bod:Addresses>
        <bod:Address>
          <bod:AddressId qualifyingAgency="%%">%%</bod:AddressId>
          <bod:AddressLine>%%</bod:AddressLine>
          <bod:City>%%</bod:City>
          <bod:County>%%</bod:County>
          <bod:StateOrProvince>%%</bod:StateOrProvince>
          <bod:Country>%%</bod:Country>
          <bod:Region>%%</bod:Region>
          <bod:PostalCode>%%</bod:PostalCode>
          <bod:Description lang="en-us" owner="%%">%%</bod:Description>
          <bod:Telephone>%%</bod:Telephone>
          <bod:FaxNumber>%%</bod:FaxNumber>
          <bod:EMailAddress>%%</bod:EMailAddress>
          <bod:URI>%%</bod:URI>
          <bod:TaxJurisdiction>%%</bod:TaxJurisdiction>
          <bod:UserArea/>
        </bod:Address>
      </bod:Addresses>
      <bod:Contacts>
        <bod:Contact>
          <bod:Person>
            <bod:PersonCode>%%</bod:PersonCode>
            <bod:PersonName>
              <bod:Salutation lang="en-us">%%</bod:Salutation>
              <bod:GivenName lang="en-us">%%</bod:GivenName>
              <bod:PreferredGivenName lang="en-us">%%</bod:PreferredGivenName>
              <bod:MiddleName lang="en-us">%%</bod:MiddleName>
              <bod:FamilyName lang="en-us">%%</bod:FamilyName>
              <bod:Suffix lang="en-us">%%</bod:Suffix>
              <bod:FormattedName lang="en-us">%%</bod:FormattedName>
              <bod:UserArea/>
            </bod:PersonName>
            <bod:UserArea/>
          </bod:Person>
          <bod:Telephone>%%</bod:Telephone>
          <bod:EMailAddress>%%</bod:EMailAddress>
          <bod:Fax>%%</bod:Fax>
          <bod:URI>%%</bod:URI>
          <bod:Description lang="en-us" owner="%%">%%</bod:Description>
          <bod:Addresses>
            <bod:Address>
              <bod:AddressId qualifyingAgency="%%">%%</bod:AddressId>
              <bod:AddressLine>%%</bod:AddressLine>
              <bod:City>%%</bod:City>
              <bod:County>%%</bod:County>
              <bod:StateOrProvince>%%</bod:StateOrProvince>
              <bod:Country>%%</bod:Country>
              <bod:Region>%%</bod:Region>
              <bod:PostalCode>%%</bod:PostalCode>
              <bod:Description lang="en-us" owner="%%">%%</bod:Description>
              <bod:Telephone>%%</bod:Telephone>
              <bod:FaxNumber>%%</bod:FaxNumber>
              <bod:EMailAddress>%%</bod:EMailAddress>
              <bod:URI>%%</bod:URI>
              <bod:TaxJurisdiction>%%</bod:TaxJurisdiction>
              <bod:UserArea/>
            </bod:Address>
          </bod:Addresses>
          <bod:UserArea/>
        </bod:Contact>
      </bod:Contacts>
      <bod:Attachments>
        <bod:Attachment inline="false">
          <bod:EmbeddedData encoding="base64">
            <bod:Data>Text</bod:Data>
          </bod:EmbeddedData>
          <bod:DocumentDate as:mask="YYYY-MM-DD">%%</bod:DocumentDate>
          <bod:Description lang="en-us" owner="%%">%%</bod:Description>
          <bod:FileType>%%</bod:FileType>
          <bod:FileSize>%%</bod:FileSize>
          <bod:Note lang="en-us" author="%%" entryDateTime="%%" as:mask='YYYY-MM-DDTHH:MM:SS-HH:MMZ'>%%</bod:Note>
          <bod:Title lang="en-us">%%</bod:Title>
          <bod:UserArea/>
        </bod:Attachment>
      </bod:Attachments>
      <bod:CorrespondenceLanguage>en-us</bod:CorrespondenceLanguage>
      <bod:Qualification>
        <bod:NameValue name="%%" type="%%">%%</bod:NameValue>
        <bod:Description lang="en-us" owner="%%">%%</bod:Description>
        <bod:Note lang="en-us" author="%%" entryDateTime="%%" as:mask="YYYY-MM-DDTHH:MM:SS-HH:MMZ">%%</bod:Note>
        <bod:UserArea/>
      </bod:Qualification>
      <bod:UserArea>
      	<xyz:NetWorthBillions as:mask='#.#####'>%%</xyz:NetWorthBillions>
      </bod:UserArea>
      </xyz:Party>
  </bod:DataArea>
</bod:SyncParty>

</as:Structure>

</as:AssemblyStructure>

             <as:BusinessUseContext>
<as:Rules>
   <as:default>
     <as:context>  
      <as:constraint action="makeMandatory(//bod:ApplicationArea/*)" />
      <as:constraint action="makeOptional(//bod:ApplicationArea/bod:Signature)" />
      <as:constraint action="makeOptional(//bod:ApplicationArea/bod:UserArea/*)" />

      <as:constraint action="makeMandatory(//bod:DataArea/bod:Sync/*)" />
      <as:constraint action="makeMandatory(//bod:DataArea/xyz:Party)" />
      <as:constraint action="makeMandatory(//bod:DataArea/xyz:Party/bod:PartyId/*)" />
      <as:constraint action="makeOptional(//bod:DataArea/xyz:Party/bod:AlternatePartyIds/*)" />
      <as:constraint action="makeRepeatable(//bod:DataArea/xyz:Party/bod:AlternatePartyIds/bod:BillToPartyId)" />

      <as:constraint action="makeOptional(//bod:DataArea//bod:Business)" />
      <as:constraint action="makeOptional(//bod:DataArea//bod:Attachments/*)" />
     </as:context>
   </as:default>
   <as:context condition="contains(//bod:DataArea//bod:Currency,'USD')">
     <as:constraint action="makeMandatory(//bod:UserArea/xyz:NetWorthBillions)"/>
   </as:context>
</as:Rules>
</as:BusinessUseContext>


<as:ContentReference>
   <as:Addressing>
    <as:registry name="OAGI" access="registry.open-applications.org:1023" method="URL"
              description="Open Applications BOD Registry"/>
    <as:registry name="USPS" access="registry.usps.gov:8080" method="URL"
              description="United States Postal Service Registry"/>
    <as:registry name="Local" access="rdbms.mybusiness.com:4040" method="SQL"
              description="Local Product Database stored procedures"/>
   </as:Addressing>

   <as:item type="noun" name="SCAC"
         UIDReference="OAGI010027" taxonomy="UID" registry="OAGI"/>
   <as:item type="noun" name="Description"
         UIDReference="OAGI010050" taxonomy="UID" registry="OAGI"/>
   <as:item type="noun" name="Rating"
         UIDReference="OAGI010028" taxonomy="UID" registry="OAGI"/>
   <as:item type="noun" name="TaxId"
         UIDReference="OAGI010029" taxonomy="UID" registry="OAGI"/>
   <as:item type="noun" name="TermId" UIDReference="none" taxonomy="none"
         datatype="text" setlength="4" setmask="'\d\d\d\d',PERL" />
   <as:item type="noun" name="xyz:NetWorthBillions" UIDReference="none" taxonomy="none"
         datatype="decimal" setLength="9" setMask="ZZ#.#####" />
   <as:item type="noun" name="Currency"
         UIDReference="070010" taxonomy="EDIFACT" registry="UN"/>
   <as:item type="noun" name="CreationDateTime"
         UIDReference="070011" taxonomy="EDIFACT" registry="UN"/>
   <as:item type="noun" name="EMailAddress"
         UIDReference="UPS050050" taxonomy="UID" registry="UPS"/>
   <as:item type="defaultAssembly" name="Address"
         UIDReference="USPS090081:01:05" taxonomy="UID" registry="USPS"/>
 </as:ContentReference>
 <!-- Version 0.92- Uses XPath with extensions -->
 <as:DataValidations>
   <as:Conditions condition="token='%DeliveryCountry%' and contains(value,'USA'">
        <as:conditional
            expression="'//DataArea/Currency' NOTequal(value,'USD')"
            syntax="XPath" outcome="fail"
            message="All prices must be in US$ for USA customers" test="always"/>
        <as:conditional itemRef="//DataArea/Business/Id" conditioncheck="value"
            expression="'//DataArea/Business/Id' and
            lookup(value,'LocalSQL:customerCheck()')" outcome="report"
            message="Customer ID not recognized" test="postcheck"/>
   </as:Conditions>

 </as:DataValidations>


</as:CAM>
<?xml version="1.0" encoding="utf-8"?>
<!--
    License information for this file is provided in LICENSE.TXT
    For support, more information, or to report implementation bugs, 
    please contact the Open Applications Group at xml@openapplications.org 
     
    ** Revision: 8.0 **
    ** Date: 05 April 2002 **
    Open Applications Group Sample XML Data
    Copyright 1998-2002, All Rights Reserved
    xmlns="http://www.openapplications.org/oagis"
    Name: SyncParty.xml
-->
<SyncParty  xmlns:xyz="http://www.XYZCorp.com/oagis/xyz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openapplications.org/oagis ../BODs/SyncParty.xsd" revision="8.0" environment="Production" lang="en-US">
	<ApplicationArea>
		<Sender>
			<LogicalId>String</LogicalId>
			<Component>String</Component>
			<Task>String</Task>
			<ReferenceId>String</ReferenceId>
			<Confirmation>0</Confirmation>
			<AuthorizationId>String</AuthorizationId>
		</Sender>
		<CreationDateTime>2001-12-17T09:30:47-05:00</CreationDateTime>
		<Signature qualifyingAgency="String"/>
		<BODId>String</BODId>
		<UserArea/>
	</ApplicationArea>
	<DataArea>
		<Sync confirm="Always">
			<SyncCriteria expressionLanguage="XPath">
				<SyncExpression action="Add">String</SyncExpression>
			</SyncCriteria>
		</Sync>
		<xyz:Party active="false" oneTime="false">
			<PartyId>
				<Id>String</Id>
				<SCAC>String</SCAC>
				<DUNS>String</DUNS>
			</PartyId>
			<AlternatePartyIds>
				<CustomerPartyId>
					<Id>String</Id>
					<SCAC>String</SCAC>
					<DUNS>String</DUNS>
					<AssigningPartyId>
						<Id>String</Id>
						<SCAC>String</SCAC>
						<DUNS>String</DUNS>
					</AssigningPartyId>
				</CustomerPartyId>
			</AlternatePartyIds>
			<Name lang="en-us">String</Name>
			<Currency>USD</Currency>
			<Description lang="en-us" owner="String">String</Description>
			<GLEntity>String</GLEntity>
			<PaymentMethod>Credit Card</PaymentMethod>
			<Rating>Good</Rating>
			<TaxExemptInd>1</TaxExemptInd>
			<TaxId>String</TaxId>
			<TermId>String</TermId>
			<Addresses>
				<Address>
					<AddressId qualifyingAgency="String">String</AddressId>
					<AddressLine>String</AddressLine>
					<City>String</City>
					<County>String</County>
					<StateOrProvince>String</StateOrProvince>
					<Country>String</Country>
					<Region>String</Region>
					<PostalCode>String</PostalCode>
					<Description lang="en-us" owner="String">String</Description>
					<Telephone>String</Telephone>
					<FaxNumber>String</FaxNumber>
					<EMailAddress>String</EMailAddress>
					<URI>http://www.xmlspy.com</URI>
					<TaxJurisdiction>String</TaxJurisdiction>
					<UserArea/>
				</Address>
			</Addresses>
			<Contacts>
				<Contact>
					<Person>
						<PersonCode>String</PersonCode>
						<PersonName>
							<Salutation lang="en-us">String</Salutation>
							<GivenName lang="en-us">String</GivenName>
							<PreferredGivenName lang="en-us">String</PreferredGivenName>
							<MiddleName lang="en-us">String</MiddleName>
							<FamilyName lang="en-us">String</FamilyName>
							<Suffix lang="en-us">String</Suffix>
							<FormattedName lang="en-us">String</FormattedName>
							<UserArea/>
						</PersonName>
						<UserArea/>
					</Person>
					<Telephone>String</Telephone>
					<EMailAddress>String</EMailAddress>
					<Fax>String</Fax>
					<URI>http://www.xmlspy.com</URI>
					<Description lang="en-us" owner="String">String</Description>
					<Addresses>
						<Address>
							<AddressId qualifyingAgency="String">String</AddressId>
							<AddressLine>String</AddressLine>
							<City>String</City>
							<County>String</County>
							<StateOrProvince>String</StateOrProvince>
							<Country>String</Country>
							<Region>String</Region>
							<PostalCode>String</PostalCode>
							<Description lang="en-us" owner="String">String</Description>
							<Telephone>String</Telephone>
							<FaxNumber>String</FaxNumber>
							<EMailAddress>String</EMailAddress>
							<URI>http://www.xmlspy.com</URI>
							<TaxJurisdiction>String</TaxJurisdiction>
							<UserArea/>
						</Address>
					</Addresses>
					<UserArea/>
				</Contact>
			</Contacts>
			<Attachments>
				<Attachment inline="false">
					<EmbeddedData encoding="base64">
						<Data>Text</Data>
					</EmbeddedData>
					<DocumentDate>2002-04-05</DocumentDate>
					<Description lang="en-us" owner="String">String</Description>
					<FileType>String</FileType>
					<FileSize>3.1415926535897932384626433832795</FileSize>
					<Note lang="en-us" author="String" entryDateTime="2002-04-05T00:00:00Z">String</Note>
					<Title lang="en-us">String</Title>
					<UserArea/>
				</Attachment>
			</Attachments>
			<CorrespondenceLanguage>en-us</CorrespondenceLanguage>
			<Qualification>
				<NameValue name="String" type="String">String</NameValue>
				<Description lang="en-us" owner="String">String</Description>
				<Note lang="en-us" author="String" entryDateTime="2002-04-05T00:00:00Z">String</Note>
				<UserArea/>
			</Qualification>
			<UserArea/>
		</xyz:Party>
	</DataArea>
</SyncParty>


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