Get string out of CDATA in xml

I have xml file with another xml file embedded in it inside CDATA. Will someone help me with the code to get that xml as string.I am using xml beans
The xml i have looks like this.
<SPFormatOrderXml><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->
<DataCommunication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\Documents and Settings\rghanta.SISCO\Desktop\NextAceProductDelivery.xsd">
     <Header>
          <Portal>
               <ClientID>100</ClientID>
               <UserID>121</UserID>
               <OrderID>100</OrderID>
               <EventID>43</EventID>
               <EventName>ServiceProviderDispatch Error</EventName>
               <DateTime>2001-12-17T09:30:47-05:00</DateTime>
               <customerEmail>[email protected]</customerEmail>
               <customerName>Client 100</customerName>
          </Portal>
          <Partner>
               <PartnerOrderID>NextAceOrderID100</PartnerOrderID>
               <PartnerName>NextAce</PartnerName>
               <PartnerID>1</PartnerID>
               <EventID>43</EventID>
               <EventName>ServiceProviderDispatch Error</EventName>
               <DateTime>2001-12-17T09:30:47-05:00</DateTime>
          </Partner>
     </Header>
     <Transaction>
          <Error>
               <ErrorCode/>
               <ErrorMessage/>
               <ErrorContact/>
          </Error>
          <Comment>
               <Private>An Internal Error has been thrown</Private>
               <Public>Order has failed</Public>
               <Information/>
          </Comment>
     </Transaction>
</DataCommunication>
]]></SPFormatOrderXml>

here is a good start -> [http://www.oracle.com/technology/oramag/oracle/03-may/o33xml.html|http://www.oracle.com/technology/oramag/oracle/03-may/o33xml.html]

Similar Messages

  • How to get String out of  void method

    I have a problem to get String out of void method. I override method actionPerformed(), and I need to use String from this method in other methods. I get nothing in smth. Can anyone help me with this.
    class
    StringBuffer smth = new StringBuffer();
    StringBuffer s;
          public void actionPerformed(ActionEvent event){
              String vnos;
              if(event.getSource() == btn_vnos){
                   input = field.getText();
                   s = new StringBuffer(input);
                    smth = s;
                }             Thanks

    You have needs to use a static variable or somehow pass an instance reference, through a list or array or some such thing, perhaps through the constructor. Or think up some other jazz, like adding a method "public String getMyStinkin'String" ;~)
    ~Cheers

  • 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:35

    Ok 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

  • How to get string value from xml in JSF??

    In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF

    Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
    JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization.

  • How to get data out of XML?

    Hi,All.
    I am running SAX (JAXP1.01) in Applet to process XML file. My question is how to get data out of xml format according to the field name (@age,@rank etc)
    and write into string buffer seperated by comma.
    Should I use SAX or DOM? (file size is big)
    My xml as follow :
    <ROOT>
    <FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@team/relay}">
         <ObjectName>Field124</ObjectName>
         <FormattedValue>HUNTER</FormattedValue>
         <Value>HUNTER</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@age}">
         <ObjectName>Field125</ObjectName>
         <FormattedValue> 19</FormattedValue>
         <Value> 19</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@Rank}">
         <ObjectName>Field126</ObjectName>
         <FormattedValue>43</FormattedValue>
         <Value>43</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{results.athrel_name}">
         <ObjectName>Field127</ObjectName>
         <FormattedValue>1-1 NORRIE</FormattedValue>
         <Value>1-1 NORRIE</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@timefield2}">
         <ObjectName>Field128</ObjectName>
         <FormattedValue>1:54.75</FormattedValue>
         <Value>1:54.75</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@timefield1course}">
         <ObjectName>Field129</ObjectName>
         <FormattedValue/>
         <Value/>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@timefield1std}">
         <ObjectName>Field130</ObjectName>
         <FormattedValue/>
         <Value/>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@timefield2course}">
         <ObjectName>Field131</ObjectName>
         <FormattedValue/>
         <Value/>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@timefield2std}">
         <ObjectName>Field132</ObjectName>
         <FormattedValue>QT</FormattedValue>
         <Value>QT</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@points(left)}">
         <ObjectName>Field133</ObjectName>
         <FormattedValue/>
         <Value/>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@pointsdecimal}">
         <ObjectName>Field134</ObjectName>
         <FormattedValue/>
         <Value/>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:decimal" FieldName="{@points(right)}">
         <ObjectName>Field135</ObjectName>
         <FormattedValue>0</FormattedValue>
         <Value>0.00</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@timefield1}">
         <ObjectName>Field136</ObjectName>
         <FormattedValue>1:55.98</FormattedValue>
         <Value>1:55.98</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@Rank}">
         <ObjectName>Field137</ObjectName>
         <FormattedValue>43</FormattedValue>
         <Value>43</Value>
    </FormattedReportObject>
    Repeat...
    </FormattedReportObject>
    </ROOT>
    ------------------------------------------------

    For big files use SAX: quicker and less memory usage.
    The xerces parser from Apache has some examples. Basically what you do is scan the XML, remembering what tag you are and once you find the right tag, read the contents.

  • Xml report getting errored out

    hi friends
    i have one custom xml report with ten parameters whenever i submiteing concurrent program with mandatory paramas it will getting succesfully completed
    without requirement out put. Again whenever i submiteed program with mandatory params and non mandatory parameters it will getting errored out .
    the error was below
    Enter Password:
    MSG-01275: Date select AND afrm.certificate_date BETWEEN :P_FROM_DATE and :P_TO_DATE
    01-OCT-11 31-DEC-11
    REP-1276: Placeholder 'CP_PARENT_NAME' references one or more non-formula columns.
    REP-0069: Internal error
    REP-57054: In-process job terminated:Terminated with error:
    REP-1276: Placeholder 'CP_PARENT_NAME' references one or more non-formula columns.
    thanks
    chandra

    Hi Chandra,
    There might be a problem with your .rdf.
    Please check the formula column and use srw.message functionality to debug.
    And please enable Trace option while you are running the report.
    So that you can get more info about the errors.

  • Getting an Out of memory exception while validating XML against XSD

    Hello friends,
    I am getting an Out Of Memory exception while validating my XML against a given XSd which is huge.
    SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
            saxParserFactory.setValidating(true);
              SAXParser saxParser = saxParserFactory.newSAXParser();
             saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
             saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource",new File("C:/todelxsd.xsd")); as u may see the darkened code. this basically Loads the XSD in Memmory , and JVM throws an out of Memory exception. is there any other way round of validating an XML against an XSD where i dont have to load my XSD if not then kindly let me know the solution for above problem .
    Thanks.

    Yes, but increasing the heap size is a temporary solution , isnt there a way where the XML can be validated against an XSD without having to load XSD in memory

  • Getting an out of memory exception while validating my XML against a XSD

    Hello friends,
    I have asked this question in following thread too. Pasting it again here just to saye your time
    http://forum.java.sun.com/thread.jspa?threadID=690812&tstart=0
    I am getting an Out Of Memory exception while validating my XML against a given XSd which is huge.
    SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
            saxParserFactory.setValidating(true);
              SAXParser saxParser = saxParserFactory.newSAXParser();
             saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
             saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource",new File("C:/todelxsd.xsd")); as u may see the darkened code. this basically Loads the XSD in Memmory , and JVM throws an out of Memory exception. is there any other way round of validating an XML against an XSD where i dont have to load my XSD if not then kindly let me know the solution for above problem .
    Thanks.

    Yes, but increasing the heap size is a temporary solution , isnt there a way where the XML can be validated against an XSD without having to load XSD in memory

  • Getting a complete portion of an XML String (With tag names)

    Im working on an application that processes a huge amount of xml strings. Im using xpath since it makes it much easier to select and navigate through the tags. The only thing I can't do is get a complete portion of an XML string, for example, if i have
    <article>
    <articlebody>
    </articlebody>
    <references>
    <reference id="1"> ... </reference>
    <reference id="1"> ... </reference>
    <reference id="1"> ... </reference>
    </references>
    </article>
    I need to get the complete <reference> portion to parse later, so i need the following string:
    <references>
    <reference id="1"> ... </reference>
    <reference id="1"> ... </reference>
    <reference id="1"> ... </reference>
    </references>
    How can i do this using xpath? is it even possible? if not how else can i do it? (don't want to use regular expressions and string manipulation)
    Thanks for you help

    Im not sure if this really qualifies as using DOM, but this is all i do to get the data i want from the files (when i only want to get the text value of an element:
    InputSource inputSource = new InputSource(new StringReader(metadata));
    return xpath.evluate(expression, inputSource, returnType);where metadata is a String containing meta data, and return type is usually string or number.
    Im using Java 5 and
    Could you please explain a little more how to do this?
    Thank you

  • New InitialContext() gets String index out of bounds

    Context ctx = null;
    ctx = new InitialContext();
    DataSource dataSource = (DataSource) ctx.lookup("jdbc/datasource");
    connection = dataSource.getConnection();
    I get:
    String index out of range: -1
    weblogic.jndi.Environment.getContext(Environment.java:308)
    weblogic.jndi.Environment.getContext(Environment.java:285)
    weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
    javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
    javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
    javax.naming.InitialContext.init(InitialContext.java:223)
    javax.naming.InitialContext.<init>(InitialContext.java:175)
    Earlier when I had provider_url specified I didn't get this problem, but it should be working without specifing provider_url...
    And well now it doesn't work with provider_url localhost since they set -Djava.net.preferIPv4Stack=true
    Which made so it stopped listening to localhost:port...
    Does someone know a possible solution for:
    1. String index of range
    2. the preferIPv4Stack thingy, which makes the listeners to stop listening to localhost:port

    Be sure values contains data.
    Then make sure that size = values.length
    Either you don't have any data to iterate through, or the size variable is too big. So it's trying to search in parts of the array that don't exist.

  • How do i get a String out of an ArrayList?

    I was trying to make a list I could grow and I was informed that arrays couldn't grow, an ArrayList was suggested.
    This seems like it will work perfectly except for the fact that I can't retrieve a String from the ArrayList.
    I'm getting errors like incompatible type String:Object or expected:[] found ArrayList.
    I tried .toString but that just gives me a bunch of giberish.
    Any advice would be most welcome.
    Thanks in advance,
    Hans.

    Ok, so, i guess here is some code you can run, it should run.
    I guess I want to know how to get each individual string out of the list one at a time.
    package arraylistone;
    import javax.swing.JFrame;
    import java.util.ArrayList;
    import javax.swing.JLabel;
    public class Main extends JFrame
                JLabel label = new JLabel();
                ArrayList list = new ArrayList();
        public Main()
            String str = "test";
            String str2 = "test2";
            list.add(str);
            list.add(str2);
            label.setText("Not Working");
            label.setText(list.toArray().toString());
                    getContentPane().add( label);
        public static void main(String[] args)
            Main frame = new Main();
            frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
            frame.pack();
            frame.setLocationRelativeTo( null );
            frame.setVisible(true);
    }

  • Generating CDATA containing XML-like text using XSLT Mapper in OFM 11g

    Hi,
    One of our partners requires XML to be sent as XML string inside a CDATA section. The use of "real" XML is not an option at the moment. We try to generate something like the following using XSLT/XSLT Mapper in SOA Suite 11g:
    <element>
    <![CDATA[
    <supplierElement1>
    <supplierElement2>
    etcetera
    <supplierElement2>
    </supplierElement1>
    ]]>
    </element>
    We've tried the following two approaches, so far unsuccessful:
    <xsl:template match="/">
    <inp1:singleString>
    <inp1:input>
    <xsl:text disable-output-escaping="yes">&lt;![CDATA[test]]&gt;</xsl:text>
    </inp1:input
    </inp1:singleString>
    </xsl:template>
    resulting in:
    <inp1:singleString xmlns:inp1="http://xmlns.oracle.com/singleString">
    <inp1:input>&lt;![CDATA[test]]></inp1:input>
    </inp1:singleString>
    and:
    <xsl:output method="xml" indent="yes" cdata-section-elements="input"/>
    <xsl:template match="/">
    <inp1:singleString>
    <input>test</input>
    </inp1:singleString>
    </xsl:template>
    resulting in:
    <inp1:singleString xmlns:inp1="http://xmlns.oracle.com/singleString" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <input>test</input>
    </inp1:singleString>
    Does anyone know how to generate the CDATA section declaratively (within XSLT/XSLT Mapper), without resorting to custom code and parsing as we have to do now?
    Thanks!
    Ronald

    The exact error message I'm getting is :
    ABAP XML formatting error in XML node of type "element", name: "abap"

  • Adapter Engine handling for CDATA in XML

    Gurus:
    I had a question on the Dapter Engines behavious, specifically the SOAP Sender.
    The Source is sending something like:
               <Data><![CDATA[<?xml version="1.0" encoding="ISO-8859-1" ?><response><forms><form ObjectId="4070" Form_Name="P40 Action"><EMP_NAME>Howard Roark</EMP_NAME><PERNR>P1111111</PERNR><WORKAUTH></WORKAUTH><HR_NAME>Scott Manager</HR_NAME><HR_PNUM>P1234567</HR_PNUM><ESIG>Scott Manager</ESIG><ELECTRONIC_SIGNATURE>Scott Manager (electronically signed)</ELECTRONIC_SIGNATURE><ESIG_VERIFICATION>Scott.Manager [Tue Jun 2 12:03:56 EDT 2009]</ESIG_VERIFICATION><ESIG_DATE>06/02/2009</ESIG_DATE></form></forms></response>]]></Data>
             </GetFormXMLResult>
    What the Integration Engine sees is the Data elelment with the CDATA section trimmed, i.e., it sees:
    <Data> <?xml version="1.0" encoding="ISO-8859-1" ?><response><forms><form ObjectId="4070" Form_Name="P40 Action"><EMP_NAME>Howard Roark</EMP_NAME><PERNR>P1111111</PERNR><WORKAUTH></WORKAUTH><HR_NAME>Scott Manager</HR_NAME><HR_PNUM>P1234567</HR_PNUM><ESIG>Scott Manager</ESIG><ELECTRONIC_SIGNATURE>Scott Manager (electronically signed)</ELECTRONIC_SIGNATURE><ESIG_VERIFICATION>Scott.Manager [Tue Jun 2 12:03:56 EDT 2009]</ESIG_VERIFICATION><ESIG_DATE>06/02/2009</ESIG_DATE></form></forms></response> </Data>
    Is this an issue with the Aapter Engine, or has anyone come accross this before? This is on PI7.0 SPS 13.
    Thanks
    Feroz

    Hi,
    the CDATA section should not be a problem. It's mostly used to include information / XML in one tag and to include special characters that should not be changed or ignored by the system. All informaiton within a CDATA element is ignored by PI and handled as "blackbox" string. PI just receives it and passes it out without really looking what's inside the tag.
    If you want to extract what's inside the CDATA element, you need to use an XSLT in your mapping (see: Handling CDATA in PI)
    Regards,
    Kai

  • How to include CDATA in xml generated from XQuery

    I need to include Cdata in the xml generated from my xquery which is given below:
    I tried using XMLCDATA, but not getting the desired output. What am I doing wrong?
    SELECT XMLQuery('<InsUpdDel>
    for $crv in ora:view("RELATION")
    return
    <first>
    <eff_date>{$crv/ROW/EFF_DATE/text()}</eff_date>
    <source>{$crv/ROW/SOURCE/text()}</source>
    <key>
    <fld>
    <id>from_type</id>
    <val>XMLCDATA({$crv/ROW/FROM_ENT_TYPE/text()})</val>
    </fld>
    <fld>
    <id>from_ent_id</id>
    <val>{$crv/ROW/FROM_ENT_ID/text()}</val>
    </fld>
    </key>
    </first>}</InsUpdDel>'
    RETURNING CONTENT)
    FROM dual;
    The output I get is XMLCDATA(C), while the desired output is <![CDATA[C]]>

    Forgive me my vanity to think I can contribute by kicking doors open that are probably already wide open....I might create more confusion, but perhaps it helps some of the readers of this thread....
    In general it is not such a good idea to use "string" functions to create (serialized) XML. XML tools (including Oracle XML DB) go through a lot of effort to make sure that when a "native" XML structure is serialized to a string, the XML rules are strictly obeyed (e.g. special character escaping).
    Just assume e.g. that the $i/Reference from above contains something like ]]><
    The resulting XML would not be valid.
    More info on serializing XML in the context of XQuery is available from
    - http://www.w3.org/TR/xquery/#id-serialization
    - http://www.w3.org/TR/xslt-xquery-serialization/
    - http://www.w3.org/TR/xslt-xquery-serialization/#XML_CDATA-SECTION-ELEMENTS
    Unfortunately I do not think Oracle XML DB currently implements these parts of the spec (perhaps 11g will)...leaving the OP's question unanswered.
    Anyway, if going the route of serializing the XML through string functions, it is always good to realize the dangers of such an approach.
    Peter

  • How to transform with xquery from CDATA to XML

    Hi everyone
    I want to transform from CDATA to XML and I don´t know how to do.
    anyone can help me please?
    I'm using OSB OEPE PS3, I have artifacts: person.PROXY, person.BIZ, BIZ-Person.WSDL, PROXY-Person.WSDL, Person-response.xq and Person.xsd.
    I Use Message Flow Within Route, Routing (Request and Response Actions)
    To Request Xquery transformation is ok, for Response Action I need help. I receive a String and inside with CDATA:
    +<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>+
    +<executeResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">+
    +<executeReturn xsi:type="xsd:string">+
    +*<![CDATA[<example-data rows="1"><person><id>123</id><name>JHON</name><surname>MAGNESS</surname>+*
    *+<code>123456789V</code></person></example-data>]]>+*
    +</executeReturn>+
    +</executeResponse>+
    +</soapenv:Body>+
    +</soapenv:Envelope>+
    I want to map from CDATA to XML like this (Person.xsd):
    <xs:schema xmlns="http://www.domain.com/XSD/Persons" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://www.domain.com/XSD/ABCD" targetNamespace="http://www.domain.com/XSD/Persons" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:import namespace="http://www.domain.com/XSD/ABCD"
    <xs:complexType name="Persons">
              <xs:sequence>++
                   <xs:element name="id" type="xs:string"/>
                   <xs:element name="surname1" type="xs:string" minOccurs="0"/>
                   <xs:element name="surname2" type="xs:string" minOccurs="0"/>
                   <xs:element name="name" type="xs:string" minOccurs="0"/>
                   <xs:element name="code" type="xs:string"/>
              </xs:sequence>
         </xs:complexType>
    Edited by: user10070593 on Aug 29, 2012 10:58 PM
    Edited by: user10070593 on Aug 29, 2012 10:58 PM
    Edited by: user10070593 on Aug 29, 2012 11:00 PM

    Hey Patrick / Vlad thank you very much for your help :)
    I have solved it like this:
    Within my proxy in Message Flow (*using Routing -- Route -- Response Action*)
    I'm using the elements Assing and Replace
    In Assing element (expression: Person-response.xq, variable: varBStoPS)
    In Replace element (xpath : executeResponse/executeReturn/text() , in Variable: body, expression:
    *$varBStoPS*)
    Now, within Person-Response.xq , I am using the parameter: *$anyType1*, but this is a string, I don´t know to use a FOR loop in Xquery, as I can apply it to the XML mapping (Person.xsd)?, Knowing I get the list:
    *+<example-data rows="1"><person><id>123</id><name>JHON</name><surname>MAGNESS</surname>+*
    *+<code>123456789V</code></person></example-data>+*
    Person.xsd:
    <xs:element name="processResponse">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="ns1:HeaderMsgABCD"/>
                        <xs:element name="bodyResponse">
                             <xs:complexType>
                                  <xs:sequence>
                                       <xs:element name="PersonsCollection">
                                            <xs:complexType>
                                                 <xs:sequence>
              <xs:element name="Persons" type="Persons" minOccurs="0" maxOccurs="unbounded"/>
                                                 </xs:sequence>
                                            </xs:complexType>
                                       </xs:element>
                                  </xs:sequence>
                             </xs:complexType>
                        </xs:element>
                        <xs:element ref="ns1:ErrorMsgABCD"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    Person-response.xq:
    xquery version "1.0" encoding "Cp1252";
    (:: pragma parameter="$anyType1" type="xs:anyType" ::)
    (:: pragma bea:global-element-return element="ns0:processResponse" location="../XSD/ Person-response.xq" ::)
    declare namespace xf = "http://tempuri.org/oracle/xquery/Person-response/";
    declare namespace ns1 = "http://www.domain.com/XSD/ABCD";
    declare namespace ns0 = " http://www.domain.com/XSD/Persons";
    declare function xf:XQ_SEARCH_PERSONS_RESPONSE($anyType1 as element(*))
    as element(ns0:processResponse) {
    <ns0:processResponse>
    <ns0:bodyResponse>
         <ns0:PersonsCollection>
    <ns0:Persons>
    <ns0:id>{ data(0) }</ns0:id>
    <ns0:surname1>{ data(0) }</ns0:surname1>
    <ns0:surname2>{ data(0) }</ns0:surname2>
    <ns0:name>{ data(0) }</ns0:name>
    <ns0:code>{ data(0) }</ns0:code>
              </ns0:Persons>
         </ns0:PersonsCollection>
    </ns0:bodyResponse>
    </ns0:processResponse>
    declare variable $anyType1 as element(*) external;
    xf:XQ_SEARCH_PERSONS_RESPONSE ($anyType1)
    Edited by: chromosoma on Aug 30, 2012 12:47 PM
    Edited by: chromosoma on Aug 30, 2012 12:50 PM
    Edited by: chromosoma on Aug 30, 2012 1:00 PM

Maybe you are looking for