Question

I am working on a migration project where the weblogic is getting migrated from weblogic 8 to 10.x

my application uses xquery and when upgraded to higher version i can see some self closing tags getting created in the transformed xml which is not the case with 8.1.

for example: I have given a simple declaration as below

let $a  := <find an attribute value>
return
<abc:value>{$a}</abc:value>

if the "find an attribute value" returns null then in weblogic 8 the node will not be sent in transformed xml but in weblogic10.x it is parsing the node as self closing one like <abc:value/>

Is this an issue with migration? I know that the xquery upgraded to 2004 and I did took care of that part. 10 Views Tags: weblogic10_3, xmlquery, xquery

Was it helpful?

Solution

If your old code doesn't accept correct XML the right answer really is to fix the old code. The two forms are semantically identical, and if the code doesn't accept that it isn't processing XML no matter what it claims.

If you absolutely can't get it fixed, I'd suggest you write a separate stage which processes the XML file as text, finds the empty-element form you don't like, and replaces it with the one you do. WARNING: Doing this properly is not easy; you have to deal with CDATA Section escaping and so on. Your best bet would probably be to get your hands on a correctly-written open-source XML serializer, such as the one in the Apache code, and modify how it handles empty elements.

OTHER TIPS

It does not seem that there's any problem.

All empty tags may be replaced by self closing tags. From an XML parser's point of view, they're totally equal. It is implementation dependent which representation of empty tags it chooses, <abc:value/> or <abc:value></abc:value>. This behavior might change from release to release.

From the XML recommendations:

Empty-element tags may be used for any element which has no content [...]

There might be an option to specify the encoding of empty tags, but any XML parser must treat both versions the same.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top