This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
This does not change anything not even the element name!
If i change my xsl to point to element fms:Receipt instead and change the root namespace to the old one xmlns:fms="http://www.agd.nsw.gov.au/xml_cicero/fms (Just for test purposes):
<xsl:element name="fms:Receipt" namespace="http://www.agd.nsw.gov.au/xml_courtlink/fms">
the following transformation output occurred then:
Any solution, can i just say i hate namespaces!!!
Didn't we do this before? Maybe it was someone else, the question comes up often enough.
That element matches a MsgCiceroTxn element which isn't in any namespace. Your MsgCiceroTxn elements are all in the default namespace, which is a namespace, so you don't match it.
Declare your default namespace URI (from the XML document) as a namespace with a prefix in your XSLT. Then match on the element with that prefix.
Joined: Mar 19, 2005
haha thanks paul ive been spending all day on this today. How to access the root element not knowing that yes it is in a default namespace but with no prefix, but i still needed to refer to the element name by a prefix in my xsl.
As for the other part removing the default namespace and changing it to a different namespace uri, that was really tricky. For anyone that wants xsl to change default namespace uri and its sibling(again i think this is bad xml code standard to call the same namespace uri even though it is the root default, i didnt code the xml output!) and change the root element of the xml document here you go:
Thanks again paul, namespaces are killing me.... ;-)