XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
ad van der endeSubject: Input namespace prefix problem
Author: ad van der ende
Date: 15 Jun 2006 03:26 PM
Hi,

When an input xml has a namespace like xmlns:UML="version1.3" and the output xml must have a namespave like xmlns:UML="version1.4" the mapping and xpath assumes the namespace with version1.4 and not he namespave with version1.3. Resulting in no data is transfered from input to output.

How to resolve this?


UnknownArisXMI2.xmi
output file

UnknownEnterpriseArchitectXMI_Roundtrip.xmi
input file

Unknownmapper.xsl.bak
mapper file

Postnext
Minollo I.Subject: Input namespace prefix problem
Author: Minollo I.
Date: 15 Jun 2006 04:10 PM
The easiest thing would be generating an XML document using a different namespace prefix (which won't affect the validity of your output); otherwise you can make the 1.3 ns definition *very* local, like in:

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:UML="omg.org/UML1.4">
<xsl:template match="/">
<XMI>
<XMI.content>
<UML:Package>
<xsl:attribute name="xmi.id">
<xsl:value-of select="XMI/XMI.content/UML:Model/UML:Namespace.ownedElement/UML:Package/@xmi.id" xmlns:UML="omg.org/UML1.3"/>
</xsl:attribute>
</UML:Package>
</XMI.content>
</XMI>
</xsl:template>
</xsl:stylesheet>

Unfortunately mapper doesn't help you with these cases; you could workaround the problem changing all occurrences of "xmlns:UML" and "UML:" to "xmlns:UML14" and "UML14" in the target document.

Postnext
ad van der endeSubject: Input namespace prefix problem
Author: ad van der ende
Date: 16 Jun 2006 12:34 AM
Another solution is to map on basis of the xsd's.
is it not?

Kind regards

ad

Posttop
Minollo I.Subject: Input namespace prefix problem
Author: Minollo I.
Date: 16 Jun 2006 08:54 AM
It depends on the schema; if the schema defines the different UML namespace using the same prefix, you will most likely end up with the same problem.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.