xsl-list
[Top] [All Lists]

[xsl] Handling a missing namespace

2012-07-05 11:27:00
Hello

I'm looking for advice on how to handle 2 different xml files in 1
transform, one has a namespace, the other doesn't.

Example with namespace...

<ns1:BigCardThing xmlns:ns1="http://xyz.com/ns1/blah/blahspec";>
                <ns1:bigCard>
                                <ns1:surname>Lastname</ns1:surname>

<ns1:givenName1>Firstname</ns1:givenName1>
                                <ns1:dateOfBirth>1971-04-04</ns1:dateOfBirth>
                                <ns1:gender>M</ns1:gender>
                </ns1:bigCard>
</ns1:BigCardThing>

...without

<BigCardThing >
                <bigCard>
                                <surname>Lastname</surname>
                                <givenName1>Firstname</givenName1>
                                <dateOfBirth>1971-04-04</dateOfBirth>
                                <gender>M</gender>
                </bigCard>
</BigCardThing>

Is there a way for xslt to look for the missing namespace and then
'add it' in the transform?

I'm using xslt 1 and Xalan.

Any advice is much appreciated!

A

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>