ALSB automatically wrapping data in a CDATA tag
I'm trying to route SOAP messages through ALSB. These messages work like this:
1) Proxy service listens for incoming SOAP request
2) Request is logged and routed to a business service (set up as "Any SOAP Service"), which queries the web service
3) Web service response is logged and passed back to Proxy service and to caller.
The problem we're having is that ALSB encodes one of the elements of the response XML in a CDATA tag. Without ALSB, there is no CDATA tag in the response.
Our calling application cannot process the message with the CDATA tag. Why does ALSB do this, and how can I prevent it from doing so without doing an expensive (and annoying to write) XQuery transform that removes the CDATA tag manually?
Thanks.
Thanks for the response.
Both the proxy service and the business service are set up as "Any Soap".
Here is an example response from the service, as captured by TCPMonitor (before ALSB gets ahold of it):
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><findAccountsResponse xmlns="http://service.account.test.com"><findAccountsReturn><?xml version="1.0" encoding="UTF-8"?>
<lt:Message xmlns:lt="http://xml.test.com/2006/01/common/Message"><lt:Header><lt:CallingApplicationId>AccountService1</lt:CallingApplicationId><lt:CallingApplicationName>Account Service</lt:CallingApplicationName><lt:CallingUser>SYSTEM</lt:CallingUser><lt:MessageId>58C4B701-1AD0-EF69-6A15-001D4D107AA9</lt:MessageId></lt:Header><lt:Body><qr:QueryResponse xmlns:qr="http://xml.test.com/2006/04/common/QueryResponse"><qr:MetaData><qr:ReturnedResults>1</qr:ReturnedResults><qr:MoreResultsExist>false</qr:MoreResultsExist></qr:MetaData><qr:Results><ac:Accounts xmlns:ac="http://xml.test.com/2006/04/Account"><ac:Account><ac:testId>111111</ac:testId><ac:Name>Test School</ac:Name><ac:Address><ac:Line1>Test Road</ac:Line1><ac:City>Hartland Cors</ac:City><ac:StateOrProvinceCode>VT</ac:StateOrProvinceCode><ac:PostalCode>05049 </ac:PostalCode><ac:Country>USA </ac:Country></ac:Address><ac:Programs><ac:Program><ac:Code>1</ac:Code><ac:Description>Test </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>2</ac:Code><ac:Description>Test </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>5</ac:Code><ac:Description>Test </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>6</ac:Code><ac:Description>Test </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>7</ac:Code><ac:Description>Test </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>8</ac:Code><ac:Description>Test </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>9</ac:Code><ac:Description>Other - Unclassified </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>10</ac:Code><ac:Description> </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program></ac:Programs></ac:Account></ac:Accounts></qr:Results></qr:QueryResponse></lt:Body></lt:Message></findAccountsReturn></findAccountsResponse></soapenv:Body></soapenv:Envelope>
Here's the contents of $body just after the business service receives the response:
<
soapenv:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="ht
tp://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/e
nvelope/">
<findAccountsResponse xmlns="http://service.account.test.com">
<findAccountsReturn><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<lt:Message xmlns:lt="http://xml.test.com/2006/01/common/Message"><lt:Header><lt:CallingApplicationId>AccountService1</lt:CallingApplicationId><lt:CallingApplicationName>Account Service</lt:CallingApplicationName><lt:CallingUser>SYSTEM</lt:CallingUser><lt:MessageId>58C4B701-1AD0-EF69-6A15-001D4D107AA9</lt:MessageId></lt:Header><lt:Body><qr:QueryResponse xmlns:qr="http://xml.test.com/2006/04/common/QueryResponse"><qr:MetaData><qr:ReturnedResults>1</qr:ReturnedResults><qr:MoreResultsExist>false</qr:MoreResultsExist></qr:MetaData><qr:Results><ac:A
ccounts xmlns:ac="http://xml.test.com/2006/04/Account"><ac:Account><ac:Life
touchId>111111</ac:testId><ac:Name>Test</ac:Name><ac:Address>
<ac:Line1>Test</ac:Line1><ac:City>Hartland Cors</ac:City><ac:Stat
eOrProvinceCode>VT</ac:StateOrProvinceCode><ac:PostalCode>05049 </ac:PostalC
ode><ac:Country>USA </ac:Country></ac:Address><ac:Programs><ac:Program><ac:Code
1</ac:Code><ac:Description>Test</ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>2</ac:Code><ac:Description>Test</ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>5</ac:Code><ac:Description>Test</ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>6</ac:Code><ac:Description>Test</ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>7</ac:Code><ac:Description>Test</ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>8</ac:Code><ac:Description>Test</ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>9</ac:Code><ac:Description>Test </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>10</ac:Code><ac:Description>Test</ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program></ac:Programs></ac:Account></ac:Accounts></qr:Results></qr:QueryResponse></lt:Body></lt:Message>]></findAccountsReturn></findAccountsResponse>
</soapenv:Body>
As you can see, ALSB is adding the CDATA tag. Our calling service can't translate the data inside of the CDATA tag.
I sincerely appreciate your help!
Similar Messages
-
Having issue with XML in CDATA tag
Currently I am having a major issue that I've been dealing with for the last four days unsuccessfully. I run a search against our data provider (lets say the term searched on is 'foobar'). We get back an XML document on our server along with a list of objects that has the start index of where the hit terms are found and the length from the start of the index (our data provider calculates all of this for us). We then take that XML document in its exact state as it's given to us from our data provider and wrap it in a CDATA tag and put it into another XML document and pass that to our FLEX app. The document looks something like this coming back from the server (we're using REST). This is not the true original document as it was shortened for readability.
<?xml version="1.0" encoding="UTF-8"?>
<Document>
<ID>123456</ID>
<HITTERMS>
<HITTERM index="45" length="6" />
<HITTERM index="105" length="6" />
<HITTERM index="260" length="6" />
</HITTERMS>
<DocumentXML><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<DOC DOCUMENT_ID="123456" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<METADATA>
<ID>123456</ID>
<LANGUAGE>ENGLISH</LANGUAGE>
<SOURCEDATA>1/1/2009</SOURCEDATA>
<SOURCE>AP</SOURCE>
</METADATA>
<ARTICLE>
<TITLE>Some title with foobar</TITLE>
<TEXT>
There would be just standard text.
Some breaks for example like the start of new paragraphs, but otherwise all the foobar text would be condensed like this.
</TEXT>
</ARTICLE>
</DOC>]]></DocumentXML>
</Document>
I've confirmed the XML coming from the server looks exactly as it does above. The issue is for some reason whenever I try to get the text out of '<DocumentXML>' it formats the code in a way that won't work for me since it throws off the offsets of the hit terms and changes the original document. Whenever I do a .toString() on the XML it puts breaks before each '<' and after each '>' so it spaces everything out inside the CDATA tag. Now the XML looks like this when turned into a string:
<?xml version="1.0" encoding="UTF-8"?>
<Document>
<ID>123456</ID>
<HITTERMS>
<HITTERM index="45" length="6" />
<HITTERM index="105" length="6" />
<HITTERM index="260" length="6" />
</HITTERMS>
<DocumentXML><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<DOC DOCUMENT_ID="123456" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<METADATA>
<ID>123456</ID>
<LANGUAGE>ENGLISH</LANGUAGE>
<SOURCEDATA>1/1/2009</SOURCEDATA>
<SOURCE>AP</SOURCE>
</METADATA>
<ARTICLE>
<TITLE>Some title with foobar</TITLE>
<TEXT>
There would be just standard text.
Some breaks for example like the start of new paragraphs, but otherwise all the foobar text would be condensed like this.
</TEXT>
</ARTICLE>
</DOC>
]]>
</DocumentXML>
</Document>
I need to be able to keep the original document as-is in the first example so I can calculate where the hit terms are so that I can highlight them and there are things further down the road that I'm going to need to be able to do so a simple search and replace will not get the job done unfortunately. Has anyone ever encountered this before or have any idea possibly how to fix this. Thanks in advance to anyone who can help with this.Didn't work. Now it spaces out all of the XML, not just the document wrapped in the CDATA tag. Looks like this now:
<?xml version="1.0" encoding="UTF-8"?>
<Document>
<ID>123456</ID>
<HITTERMS>
<HITTERM index="45" length="6" />
<HITTERM index="105" length="6" />
<HITTERM index="260" length="6" />
</HITTERMS>
<DocumentXML>
<![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<DOC DOCUMENT_ID="123456" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<METADATA>
<ID>123456</ID>
<LANGUAGE>ENGLISH</LANGUAGE>
<SOURCEDATA>1/1/2009</SOURCEDATA>
<SOURCE>AP</SOURCE>
</METADATA>
<ARTICLE>
<TITLE>Some title with foobar</TITLE>
<TEXT>
There would be just standard text.
Some breaks for example like the start of new paragraphs, but otherwise all the foobar text would be condensed like this.
</TEXT>
</ARTICLE>
</DOC>
]]>
</DocumentXML>
</Document> -
Parsing errors with CDATA tags using oracle xml parser v2
I'm using the oracle.xml.parser.v2 parser to combine a
generated xml document from a database with a static
xsl file to produce html. Within the xml document, there
are fairly large CDATA sections (500 lines) which happen
to contain javaScript.
Occasionally, I'm getting xml tags in the final html
document! It seems that the oracle parser pukes
on a certain type of data within a CDATA tag, and then
replaces an angle bracket (<) of a tag with a #60. This
can cause html tags being viewed in the document. At
first, I thought the amount of JavaScript within the
CDATA tag was too large for the parser to handle,
because when I split it up into 2 or more parts the errors
went away. But, re-arranging the JavaScript (String in the CDATA tag)
can make the errors disappear. And, if I
use the Saxon parser to manually combine the xsl with
the xml, the output is fine. If anyone knows that this is
a confirmed bug by Oracle, or any other relevant info on
this, please let me know.Hi,
Your lucky, i've just finished a project that used the oracle parser extensively.
I think the problem may stem from your xsl. Although your cdata tags may be well formed, in the xsl you might need to escape the text again, this may mean that the xsl needs to print a further cdata tag around the data. This is because the parser (well the version I was using) strips the cdata tags before the transformation happens.
This is the probably the cause of the nasty html output. -
ALSB 3.0 - Problem adding CDATA Tags using XSLT
Hi all,
I am having a problem using ALSB to insert CDATA tags into some XML.
Here's a simple example of the stylesheet I am using:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="[http://www.w3.org/1999/XSL/Transform]" version="1.0">
<xsl:template match="/">
<a>
<xsl:value-of disable-output-escaping="no" select="'<![CDATA['"/>
<b/>
<xsl:value-of disable-output-escaping="no" select="']]>'"/>
</a>
</xsl:template>
</xsl:stylesheet>
In XMLSpy, this produces the following output:
<a>
<![CDATA[
<b />
]]>
</a>
Which is correct.
However, when running the same transformation as an XSLT in ALSB, I get the following output:
<a>
<?javax.xml.transform.disable-output-escaping?>
& lt ;
<?javax.xml.transform.enable-output-escaping?>
![CDATA[
<b />
<?javax.xml.transform.disable-output-escaping?>
& gt ;
<?javax.xml.transform.enable-output-escaping?>
</a>
From some digging about online, I've found that the
"<?javax.xml.transform.enable-output-escaping?>" elements are
processing instructions.
Has anyone else had similar issues?
Or more importantly, has anyone fixed this?
Cheers,
Dave
Edited by: DaveFeeder on 10-Dec-2008 12:36I've found a solution to this now.
I've used the fn-bea:serialize XQuery function to serialized the data, having the same effect as manually trying to insert the CDATA,and if anything, is a neater solution.
Cheers
Dave -
Encapsulating Data in XML Output in CDATA tags
Hi,
I have a simple pdf fillable form that I created in LiveCycle Designer ES that saves/submits form data as XML for parsing into a database. The database parser requires all form data to be encapsulated into CDATA tags inside the XML fieldnames or it will not process it. Can anyone give some pointers to force the XML output to encapsulate the data inside CDATA tags within the XML fieldnames in my output XML file? Thanks.
DanHi Dan,
Can you post a sample of what you want the xml to look like. If I understand correctly, it sounds like a very strange parser. I would imagine you would have to preprocess the xml on the server.
Regards
Bruce -
How to insert a new line character inside CDATA tag in the source xml data file?
values for form fields in the xml data file is contained inside CDATA tags which is an Unparsed Format.
Eg: [CDATA[IBM-01 ~ DSHFSJDSJ ~ FGFGFJ, ~ VA 665665]] delimited by "~" char
Actual o/p:-
IBM-01 ~ DSHFSJDSJ ~ FGFGFJ, ~ VA 665665
Expected o/p is like :-
IBM-01
DSHFSJDSJ
FGFGFJ,
VA 665665
live cycle product does not interpret ~ as a newline character. Please suggest which character should be used instead inside CDATA section or if there is any other way to fix this?I do not have any problem while using IE's XML parser
for XML+XSLT merging.That is because IE's parser does not implement XML correctly.
But when I use JAXP's Transformer object, it does not
preserve the new lines inside attribute values and
converts those into white spaces.That is exactly what the XML specifications say should happen.
>
----If you have text that contains newlines, you
should put it in an element, not in
----an attribute.
That would be my last solution. But I'd really hate
to change my logic just 'coz JAXP is not capable of
handling new lines inside attribute values. I may be
wrong... but If IE can keep those then there has to
be a way to do the same from server side merging....Sure. Write your own parser with the same bug in it. But you don't have any right to demand that other people supply you with parsers that work incorrectly. -
How to display data containing CDATA tags in JSP/HTML?
Hi,
I'm getting some data from a webservice and displaying it in JSP. But some data from the service (like description of an item) contains CDATA tags.
For ex: This is the data from the webservice.
<BenefitsIssues><![CDATA[This strategy buys after a very rapid or extreme sell off with the hope that the gap will eventually be filled. <br>Typically, traders following these types of strategies expect some very large losses as downtrends continue.<br>Traders should take only very small positions when trading this strategy and never dedicate more than a small amount of risk capital in aggregate to this strategy.]]></BenefitsIssues>
where <BenefitsIssues> is the XML tag. My code displays everything within this tag in JSP.
Code is JSP looks like this.
<tr><td><%=strategyDescriptor.getBenefitsIssues()%></td></tr>
Eventually the HTML output of this JSP looks like..
<tr><td>![CDATA[This strategy buys after a very rapid or extreme sell off with the hope that the gap will eventually be filled. <br>Typically, traders following these types of strategies expect some very large losses as downtrends continue.<br>Traders should take only very small positions when trading this strategy and never dedicate more than a small amount of risk capital in aggregate to this strategy.]]</td></tr>
Problem is that the page fails to display the first line, "This strategy buys after a very rapid...." and starts displaying only from "Typically, traders following these....", i.e after the occurrence of first <br> tag. Page also displays "]]" at the end.
How I can get rid of this problem? One way is to remove "![CDATA[" and "]]" from the data received from webservice. I would like to know if any other better solutions is there. Is there any predefined function to remove "![CDATA[" ?
Thanks in advance for the help.
-Prasannawrite tha bean class with the return type like. vector,arraylist .
add the result set values to vector.
for example
Vector s = new Vector();
while(rs.next)
s.add(rs.getString());
at last return that s.
return s;
// IN Jsp page;
<ur dropdown come here>
<%
Vector Test = new Vector();
Test = call function contains databasevalues();
for(int i=0;i<Test.size();i++)
%>
<option><%=Test.get(i)%></option>
<%}%>
%>
Message was edited by:
kamal_shan -
Using CDATA tags in XML program and parsing to J2ME
Hi,
Can anybody tell me how to use CDATA tag in a xml file and parse it to my J2ME code. is there any sample code available for this? I want to use this CDATA tag for sending Binary data. plzzzzzzz Help....!I think what you want is to parse a CDATA text from a xml file and let this text to execute.
Very innovative idea!
If I am right, I think you might mix some concept.
Java code need to be changed to ByteCode before pased to the JVM. Furthermore, Java ME code must be verified before downloading to your machine.
I figure that your attempt is impossible. -
How would I get information out of a Cdata tag?
Read in CDATA[] based information? I can never find out how to access the data inside of Cdata. Any one got any ideas? we never covered this in school and google just confuses me. So how do you get all the data out of Cdata to do what ever with it? this is for converting xml to cvs - which I think I can do, I just need to get the data out of cdata ...
Edited by: 910481 on 26-Jan-2012 20:35Ok so now I have some code but its spitting out the second return, which states "there isn't anything there"
package xmlcsv;
import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.CharacterData;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
* @author Adam Balan
public class XmlCSV {
* @param args
public static void main(String[] args) throws Exception {
File file = new File("Data.xml");
DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = db.parse(file);
NodeList nodes = doc.getElementsByTagName("TransmissionWrapper");
for (int i = 0; i< nodes.getLength(); i++){
Element element = (Element) nodes.item(i);
NodeList cData = element.getElementsByTagName("TransmissionData");
Element line = (Element) cData.item(0);
//test
System.out.println("Data: " + getCData(line));
* We want to get all the data out of the CData Section
* @param e
* @return
public static final String getCData(Element e)
Node child = e.getFirstChild();
if(child instanceof CharacterData)
CharacterData cd = (CharacterData) child;
return cd.getData();
return "Theres nothing there";
}the tag would be:
<TransmissionWrapper>
<TransmissionData Name="bla" Value="bla bla">
<![Cdata[Bla|bla]]>
</TransmissionData>
</TransmissionWrapper>So...What am I doing wrong for it to spit out: Theres nothing there
Thanks for your help and paitence
Edited by: Salacious on 27-Jan-2012 11:46
Edited by: Salacious on 27-Jan-2012 11:46 -
Wrap XML with in CDATA using webservice
Hi folks,
i have a requirement to generate highlighted XML with in CDATA tag using web service for KENEXA integration.
<?xml version="1.0"?>
<Envelope version="01.00">
<Sender>
<Id>HRISUSER</Id>
<Credential>100</Credential>
</Sender>
<Recipient>
<Id/>
</Recipient>
<TransactInfo transactType="data">
<TransactId>5555</TransactId>
<TimeStamp>2006-02-28 09:22:10AM</TimeStamp>
</TransactInfo>
<Packet>
<PacketInfo packetType="data">
<PacketId>1</PacketId>
<Action>SET</Action>
<Manifest>MANIFESTNAME</Manifest>
</PacketInfo>
<Payload><![CDATA[<?xml version="1.0"?>
<Foundation_Data>
<Foundation_Item>
<Code>0001</Code>
<Description>Code 1</Description>
<Status>A</Status>
</Foundation_Item>
<Foundation_Item>
<Code>0002</Code>
<Description>Code 2</Description>
<Status>I</Status>
</Foundation_Item>
</Foundation_Data>
]]></Payload>
</Packet>
</Envelope>
To know more about kenexa integration Foundation Integrations
Please guide me with this.
Regards,
Srinivasan R.Hi folks,
i have a requirement to generate highlighted XML with in CDATA tag using web service for KENEXA integration.
<?xml version="1.0"?>
<Envelope version="01.00">
<Sender>
<Id>HRISUSER</Id>
<Credential>100</Credential>
</Sender>
<Recipient>
<Id/>
</Recipient>
<TransactInfo transactType="data">
<TransactId>5555</TransactId>
<TimeStamp>2006-02-28 09:22:10AM</TimeStamp>
</TransactInfo>
<Packet>
<PacketInfo packetType="data">
<PacketId>1</PacketId>
<Action>SET</Action>
<Manifest>MANIFESTNAME</Manifest>
</PacketInfo>
<Payload><![CDATA[<?xml version="1.0"?>
<Foundation_Data>
<Foundation_Item>
<Code>0001</Code>
<Description>Code 1</Description>
<Status>A</Status>
</Foundation_Item>
<Foundation_Item>
<Code>0002</Code>
<Description>Code 2</Description>
<Status>I</Status>
</Foundation_Item>
</Foundation_Data>
]]></Payload>
</Packet>
</Envelope>
To know more about kenexa integration Foundation Integrations
Please guide me with this.
Regards,
Srinivasan R. -
Changing Color of what is between the CDATA tags
Hi.. I am doing a lot of code replacement and it would be
really cool to be able to have the contents of the cdata tags a
different color.
I know you can change tag colors in the codecoloring.xml file
, but no clue how to add what I want.
<calloutcopy><![CDATA[My colored text here so I can
see what to change easier]]></calloutcopy>
basically the <![CDATA[ ]]> tag to be a different color
Thanks
DaxDax,
You can change the color of the *contents* in the Code
Coloring
Preferences. Select the XML Document Type, then click "Edit
Coloring
Scheme". Set the color of the "XML Text" style.
The data for the Code Coloring feature is stored in XML, for
which
"<![CDATA[" has a special meaning, so there is currently
no way to
change the color of the CDATA tag itself.
Hope this helps,
Randy
> I am doing a lot of code replacement and it would be
really cool to be
> able to have the contents of the cdata tags a different
color.
>
> I know you can change tag colors in the codecoloring.xml
file , but no clue
> how to add what I want.
>
> <calloutcopy><![CDATA[My colored text here so I
can see what to change
> easier]]></calloutcopy>
>
> basically the <![CDATA[ ]]> tag to be a different
color
> Thanks -
Remove Cdata tags from XML body
Integration Broker message is being publish from the Peoplecode in the savepostchange event of a page......So basically when they click on the save, it is being published.
ok, I have title field on a page and the user entered special character "&" and there is a HTML definition being used and that definition goes through parsexmlstring function.
For example In the cust_title field on a page the user entered " A & B"
I went to the HTML definition and wrapped cust_title field in the CDATA tags like <![CDATA[<Title>%BIND(:8)</Title>]]>
Now , there is no error, XML is getting published. But in the xml message
I see Cdata tags and string is appearing exactly as it was entered.....
But how can I get rid of the Cdata tags from the XML message?Dear Odie,
May I make your example a bit more complicated by adding an additional complexType, please:
---Original ----
<DEPT>
<EMPID>1</EMPID>
<EMPNAME>Martin Chadderton</EMPNAME>
<SALARY>??</SALARY>
<SALARYq></SALARYq>
</DEPT>
----- New ----
<DEPT>
<EMPID>1</EMPID>
<EMPNAME>Martin Chadderton</EMPNAME>
<SALARY>??</SALARY>
<SALARYq></SALARYq>
<EMPLMNT_HISTORY>
<DEVISION>1</DEVISION>
<FROM_DATE>2011-01-01 </FROM_DATE>
<TO_DATE></TO_DATE>
</EMPLMNT_HISTORY>
</DEPT>
Your solution works perfectly for <SALARY>, but how would you suggest also to deal with <TO_DATE> ?
Massive thanks for your help!
N.B. Just to emphasise, in my case I have 3 levels (complexType > complexType > complexType) and many elements and I would like to know if there is any generic option to say
to remove all the empty elements from the result, as it causes to the SSJ (Systinet) Webservice to crash. -
In the examples in the designers workshop, they use the
example.xml file which has a feature tage containing a CDATA tag
full of html code. which renders in a spry widget just fine.
After installing the prerelease, I can not get the CDATA tags
to render any html or .css code. anyone else have this
problem??okay i must be doing something really dumb here that i can't
see. i'd like to copy all my code if you can bear with me.
my xml file with only one entry at present
<?xml version="1.0" encoding="utf-8"?>
<upcoming>
<tradeshow>
<event>conference</event>
<date>Nov 5-7, 2008</date>
<booth></booth>
<location>USA</location>
<url><![CDATA[<a href="
http://www.google.com">www.google.com</a>
<photo><![CDATA[<img src="../images/1.gif"
/>]]</photo>
</tradeshow>
</upcoming>
my file
<div class="twoColFixRtHdr">
<div id="mainLinks" spry:region="dsEvents">
<table id="EventsTable">
<tr>
<th spry:sort="event">Event</th>
<th spry:sort="date">Date</th>
</tr>
<!-- user clicks to reset the current row in the data set
-->
<tr spry:repeat="dsEvents" spry:setrow="dsEvents"
spry:hover="tdhover" spry:select="tdselect">
<td>{event}</td>
<td>{date}</td>
</tr>
</table>
</div>
<!-- create the detail dynamic regiod -->
<div id="mainContent" spry:detailregion="dsEvents"
spry:hover="tdhover" spry:select="tdselect">
<table id="EventsTableDetail">
<tr>
<th colspan="3">Photo</th>
</tr><tr>
<td colspan="3">
<div spry:choose="spry:choose">
<div spry:when="'{@path}' ==
'down.jpg'">{@photo}</div>
<div spry:when="'{@path}' == 'undefined'">Path was not
defined.</div>
<div spry:default="spry:default">Unexpected value for
path!</div>
</div>
</td>
</tr><tr>
<th>Booth</th>
<th>Location</th>
<th>Url</th>
</tr><tr>
<td>{booth}</td>
<td>{location}</td>
<td>{url}</td>
</tr>
</table>
</div>
</div>
</td>
</tr></table>
<script type="text/javascript">
<!--
var dsEvents = new Spry.Data.XMLDataSet("../xml/Events.xml",
"upcoming/tradeshow",{sortOnLoad:"event",sortOrderOnLoad:"ascending"});dataset.setColumnT ype('photo','image');dataset.setColumnType('url','html');
-->
</script>
If i simply list the items no setting columns just the
sorting in dsEvents and don't use spry:choose I get a nice list
that is sortable.
thanks V1 Fusion for your help. Can you or anyone see what
i'm doing wrong? -
Problem retrieving Data from a CDATA-Section using XMLDOM
Hello,
Ware: Oracle 8.1.7.4 64bit, XDK for PL/SQL Version 9.2.0.3, Solaris8 64bit
I can't retrieve Data from the CDATA-Section of an XML-String, neither with
getData(DOMCharacterData) or substringData. Also getLength fails. I get always
the following error:
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception: java.lang.ClassCastException
ORA-06512: at "XML_SCHEMA.XMLCHARDATACOVER", line 0
ORA-06512: at "XML_SCHEMA.XMLDOM", line 853
ORA-06512: at "SCHWABE.XML_TEST", line 47
ORA-06512: at line 1
I can successfully cast the DOMNode to a CharacterData with makeCharacterData
and check with isNull (DOMCharacterData) (returns FALSE).
My Testcase:
1) A Function which build a XML-Document:
CREATE OR REPLACE FUNCTION XML_ResponseCalc RETURN VARCHAR2 IS
doc VARCHAR2(32767);
BEGIN
doc :=
'<?xml version="1.0" encoding="UTF-8"?>
<RSDecEng>
<Version>1.00</Version>
<ResponseCalc>
<ID>00000000000000000014</ID>
<Burst>
<Definition>
<Count>1</Count>
<ID>
<Start>1</Start>
<Length>4</Length>
</ID>
<Var>
<Name>Risiko_1</Name>
<Start>5</Start>
<Length>5</Length>
</Var>
</Definition>
<Data>
<Length>9</Length>
<Count>5</Count>
<![CDATA[
1 0.001
2 0.002
3 0.003
4 0.004
5 0.005
6 0.006
7 0.007
8 0.008
9 0.009
10 0.010
]]>
</Data>
</Burst>
</ResponseCalc>
</RSDecEng>
2) The Procedure which parses the XML-Document (no Exception-Handling):
CREATE OR REPLACE PROCEDURE XML_TEST IS
Parser XML_SCHEMA.XMLParser.Parser;
DOMDocument XML_SCHEMA.XMLDOM.DOMDocument;
DOMNode XML_SCHEMA.XMLDOM.DOMNode;
DOMNodeItem XML_SCHEMA.XMLDOM.DOMNode;
DOMNodeList XML_SCHEMA.XMLDOM.DOMNodeList;
DOMCharacterData XML_SCHEMA.XMLDOM.DOMCharacterData;
TheDocument CLOB;
ID VARCHAR2(100);
Data VARCHAR2(200);
BEGIN
-- LOB
DBMS_LOB.CREATETEMPORARY(TheDocument, TRUE);
DBMS_LOB.WRITEAPPEND(TheDocument, LENGTH(XML_ResponseCalc), XML_ResponseCalc);
-- Parse
Parser := XML_SCHEMA.XMLParser.NewParser;
XML_SCHEMA.XMLParser.ParseCLOB(Parser, TheDocument);
DOMDocument := XML_SCHEMA.XMLParser.GetDocument(Parser);
XML_SCHEMA.XMLParser.FreeParser(Parser);
-- Node
DOMNode := XML_SCHEMA.XMLDOM.MakeNode(DOMDocument);
-- Get ID
DOMNodeList := XML_SCHEMA.XSLProcessor.SelectNodes
(DOMNode,'/RSDecEng/ResponseCalc/ID/text()');
IF XML_SCHEMA.XMLDOM.GetLength(DOMNodeList) > 0 THEN
DOMNodeItem := XML_SCHEMA.XMLDOM.Item(DOMNodeList, 0);
XML_SCHEMA.XMLDOM.WriteToBuffer(DOMNodeItem, ID);
SYS.DBMS_OUTPUT.PUT_LINE ('ID: '||ID);
END IF;
-- Get CDATA
DOMCharacterData := XML_SCHEMA.XMLDOM.MakeCharacterData(DomNode); -- <-- ok here...
IF NOT XML_SCHEMA.XMLDOM.isNull (DOMCharacterData) THEN -- <-- ...and here
Data := XML_SCHEMA.XMLDOM.GETDATA(DOMCharacterData); -- <-- ...but here Exception raise
END IF;
END;
I hope you can help me.
Thank you in advance
Markus SchwabeYou need to notice the definitions for makecharacterdata:
FUNCTION makeCharacterData(n DOMNode) RETURN DOMCharacterData;
PURPOSE
Casts given DOMNode to a DOMCharacterData
It only do the casting. -
Error message: when downloading data from 2nd display tag table
I am using disaply tag to display data in jsp page. I am using three different section to display the data with three display tag table. The data is displaying correctlly. The display tag downlod excel sheet is working for first display tag table. When i am trying to download data from 2nd and 3rd display tag table i am getting following error:
Exception: [.TableTag] Unable to reset response before returning exported data. You are not using an export filter. Be sure that no other jsp tags are used before display:table or refer to the displaytag documentation on how to configure the export filter (requires j2ee 1.3).
at org.displaytag.tags.TableTag.writeExport(TableTag.java:1438)
at org.displaytag.tags.TableTag.doExport(TableTag.java:1364)
at org.displaytag.tags.TableTag.doEndTag(TableTag.java:1215)
at org.apache.jsp.InstalBase_005fReport_jsp._jspService(InstalBase_005fReport_jsp.java:974)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:595)
As per the Exception i don't have any jsp tag before the display tag.
Please help me if any body has any solution for the above exception.
Thanks in advance.
Smruti..See also http://helpx.adobe.com/acrobat/kb/pdf-browser-plugin-configuration.html
Maybe you are looking for
-
Can i remove purchased content from one itunes account to a new account?
i have 3 ipads on my one icloud account and my one phone my family shares the content on the 3 ipads. I am getting my oldest child a i phone and want to move some of the shared content to her new phone and one if the ipads.to her own itunes account.
-
Looking for a step-by-step how-to: I have a wide overhead shot of a brewery bottling line and detail shots of the steps in the bottling process. I'm trying to highlight those steps, with say, an spotlight of some sort that widens to reveal the detail
-
Itunes freezes at the end of podcasts
Not everyone, but if i have 10-20 to watch, itunes will lock up 3-4 times. it's only at the end of the podcast, sometimes after a few mins it will just carry on, mostly it just locks up and i have to end task it. i'm using win7 64bit
-
Oracle 10 g is not able to start
hi to all sap-oracle gurus. i am trying to install oracle 10g it is giving the below error Error in writing to directory c:\WINDOWS\TEMP\OraInstall2006-01-01_01-18-15am. Please ensure that this directory is writable and has atleast 45 mb of disk spa
-
Linking solution manager projects with CHARM implementation project
Hi Guys, Currently i am working in CHARM implementation project, i have created one CHARM implementation project with urgent correction and i am able to create the Transport request and release the transport request succesfully and i am able to move