Posted: Thu Oct 04, 2007 4:48 pm Post subject: XMLNS namespace prefix not to be present at each element
Apprentice
Joined: 22 Jan 2003 Posts: 39 Location: USA
I am trying to create an output xml as below:
-----------
<?xml version="1.0" encoding="UTF-8"?>
<a:b xmlns:a="http://test.com">
<item>
<iNo>i1</iNo>
<iP>1.0</iP>
</item>
<item>
<iNo>i2</iNo>
<iP>2.0</iP>
</item>
</a:b>
------------
But with the ESQL code, the o/p is as follows,
----------
<?xml version="1.0" encoding="UTF-8"?>
<a:b xmlns:a="http://test.com">
<a:item>
<iNo>i1</iNo>
<iP>1.0</iP>
</a:item>
<a:item>
<iNo>i2</iNo>
<iP>2.0</iP>
</a:item>
</a:b>
----------
here is the esql code:
-----------
DECLARE ns NAMESPACE 'http://test.com';
SET OutputRoot.XMLNS.ns:b.(XML.NamespaceDecl)xmlns:a='http://test.com';
SET OutputRoot.XMLNS.ns:b.ns:item[] = EV.RS[];
here EV.RS[] has resultset from database.
-----------
is it possible to have the prefix not added to element "item" (<a:item>), just have it added at the top.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum