Transforming XML Data with XSLT in a servlet

Trying to transform XML data using XSLT. The following code works fine outside of a servlet. But in a servlet it gives the following error :
* Transformer Factory error
javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Namespace not supported by SAXParser
javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Namespace not supported by SAXParser
     at org.apache.xml.utils.DefaultErrorHandler.fatalError(DefaultErrorHandler.java:257)
     at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:813)
     at TransformationApp.XSLTTransformServlet.MyTransform(XSLTTransformServlet.java:79)
     at TransformationApp.XSLTTransformServlet.doGet(XSLTTransformServlet.java:39)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
     at org.apache.tomcat.core.Handler.service(Handler.java:287)
     at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
     at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
     at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
     at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
     at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
     at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
     at java.lang.Thread.run(Thread.java:484)
Several articles hinted at setting the factory namespace attribute to TRUE. I have tried that but same results. Here is the code :
static Document document;
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
//factory.setNamespaceAware(true);
//factory.setValidating(true);
try {
File stylesheet = new File(argv[0]);
File datafile = new File(argv[1]);
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse(datafile);
// Use a Transformer for output
TransformerFactory tFactory =
TransformerFactory.newInstance();
StreamSource stylesource = new StreamSource(stylesheet);
Transformer transformer = tFactory.newTransformer(stylesource);
DOMSource source = new DOMSource(document);
StreamResult result = new StreamResult(System.out);
transformer.transform(source, result);
} catch (TransformerConfigurationException tce) {
// Error generated by the parser
System.out.println ("\n** Transformer Factory error");
System.out.println(" " + tce.getMessage() );
// Use the contained exception, if any
Throwable x = tce;
if (tce.getException() != null)
x = tce.getException();
x.printStackTrace();
} catch (TransformerException te) {
// Error generated by the parser
System.out.println ("\n** Transformation error");
System.out.println(" " + te.getMessage() );
// Use the contained exception, if any
Throwable x = te;
if (te.getException() != null)
x = te.getException();
x.printStackTrace();
} catch (SAXException sxe) {
// Error generated by this application
// (or a parser-initialization error)
Exception x = sxe;
if (sxe.getException() != null)
x = sxe.getException();
x.printStackTrace();
} catch (ParserConfigurationException pce) {
// Parser with specified options can't be built
pce.printStackTrace();
} catch (IOException ioe) {
// I/O error
ioe.printStackTrace();
Any help would be greatly appreciated.

I don't know that this is true, but i think the problem is the classpath.
The runtime has his own parser. This parser is befor your xalan.lib in the classpath and the
parser from the runntime don't support namespace.
Try Tomcat 4.
Regard Dietmar

Similar Messages

  • Store xml data with difference dtd in the same xmltype column?

    Hi, all!
    I want to know, whether i can store the xml data with difference DTD in the same xmltype column.
    thank you for your help
    rabbit

    As long as the column is not based on an XML Schema

  • Transforming XML data into SVG line charts using XSLT

    Hi
    I am trying to transform revenue data from an XML file into an SVG line chart. The problem is that I am quite new to XPath and XSLT and whereas I can draw the grid for my chart I struggle drawing the lines using the data from the XML doc.
    The XML look something like the one below, and I would like to have one chart for each product and in each chart having the time on the x-axis and chart the revenue by regions.
    Any help on this is much appreciated.
    Thanks
    Peter
    <?xml version="1.0"?>
    <revenue>
    <caption>
    <heading>My title</heading>
    </caption>
    <date name="01/01/2003">
    <region name="Asia">
    <product_a>30</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    </date>
    <date name="02/01/2003">
    <region name="Asia">
    <product_a>32</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>57</product_a>
    <product_b>31</product_b>
    <product_c>457</product_c>
    </region>
    </date>
    <date name="03/01/2003">
    <region name="Asia">
    <product_a>38</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>31</product_a>
    <product_b>9</product_b>
    <product_c>357</product_c>
    </region>
    </date>
    <date name="04/01/2003">
    <region name="Asia">
    <product_a>33</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>43</product_a>
    <product_b>16</product_b>
    <product_c>430</product_c>
    </region>
    </date>
    <date name="05/01/2003">
    <region name="Asia">
    <product_a>36</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>54</product_a>
    <product_b>1</product_b>
    <product_c>561</product_c>
    </region>
    </date>
    </revenue>

    You could try Jeni's XSLT utilities for SVG :
    http://www.jenitennison.com/xslt/utilities/svg-utils.html
    Specifically, the sample code provided, when a couple of SVG charts are being generated from XML data :
    http://www.jenitennison.com/xslt/utilities/svg-example.html
    Hope that helps.

  • Problem with x:transform function : translation with XSLT

    I've got a problem with this code :
    This is the XML file :
    <%@taglib prefix="x" uri="http://java.sun.com/jstl/xml"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
    <c:import var="xslDoc" url="test.xsl"/>
    <x:transform  xslt ="${xslDoc}">
      <students>
      <student id="1">
       <name>
         <first>John</first>
         <last>Smith</last>
         <middle>T</middle>
       </name>
       <grade>
         <points>72</points>
         <letter>C</letter>
       </grade>
      </student>
    </students>
    </x:transform>This is the XSLT :
    <xsl:stylesheet version="1.0"
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="students">
      <html>
      <head>
      <title>XSLT Transform</title>
      </head>
      <body>
       <table border="1">
       <tr><th>First</th><th>Last</th>
    <th>Points</th><th>Letter</th></tr> 
       <xsl:apply-templates/>
       </table>
       </body>
      </html>
    </xsl:template>
    <xsl:template match="student">
      <tr>
       <td><xsl:value-of select="name/first"/></td>
       <td><xsl:value-of select="name/last"/></td>
       <td><xsl:value-of select="grade/points"/></td>
       <td><xsl:value-of select="grade/letter"/></td>
      </tr>
    </xsl:template>
    </xsl:stylesheet>I use NetBeans 3.5.1 for compiling and testing, and on my machine all works fine.
    But when i upload the code on the server i''ve this type of error :
    HTTP Status 500 - Internal Server Error
    exception
    org.apache.jasper.JasperException: access denied (java.util.PropertyPermission org.xml.sax.driver read)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:98)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:176)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:172)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:457)
         at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:576)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    java.security.AccessControlException: access denied (java.util.PropertyPermission org.xml.sax.driver read)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
         at java.security.AccessController.checkPermission(AccessController.java:401)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
         at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1291)
         at java.lang.System.getProperty(System.java:572)
         at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:81)
         at org.apache.taglibs.standard.tag.common.xml.TransformSupport.getSource(TransformSupport.java:280)
         at org.apache.taglibs.standard.tag.common.xml.TransformSupport.getSource(TransformSupport.java:276)
         at org.apache.taglibs.standard.tag.common.xml.TransformSupport.doStartTag(TransformSupport.java:159)
         at org.apache.taglibs.standard.tag.el.xml.TransformTag.doStartTag(TransformTag.java:104)
         at org.apache.jsp.test_jsp._jspService(test_jsp.java:78)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:98)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:176)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:172)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:457)
         at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:576)
         at java.lang.Thread.run(Thread.java:536)
    org.apache.jasper.JasperException: access denied (java.util.PropertyPermission org.xml.sax.driver read)It seems a permission problem, but my experience with JSP is very poor , i've asked to control to my host
    the policy of the folders but they didn't respond me yet.
    Any suggestion ?
    Thx for reading, and sorry for my rusty english :-P

    Thanks.
    I've already tried to insert the whole path. You mean this,right ?
    <c:import var="xslDoc" url="http://www.domain.net/examples/test.xsl"/>I've searched a lot with google but i haven't find anything.
    I've not searched a lot into the jakarta site, I'll do tomorrow, now it's
    a bit late (1:45 AM in Italy :-0 ), so i think that i'll go to sleep.
    Thanks for responding so soon!
    I'll wait for your new infos.
    Thanks again.
    read you tomorrow.

  • Target XML attribute with XSLT

    Hello,<br />I have an xml file which looks like this:<br /><br /><PRODUCTS><br /><PRODUCT><br /><IMAGE href="file://./0001.tif"></IMAGE><br /></PRODUCT><br /><PRODUCT><br /><PRODUCTS><br /><br />Is there a way to target the href attribute of the PRODUCT element with XSLT?<br /><br />Thanks

    hi marco,
    > Thank you gregor, I'll take a look to this reference; I'm total newby to
    > XSLT, so any suggestions would be surely fine.. another question: do you
    > think it's better to work with XSLT or XmlRules?
    there is no short answer on this. it depends on your documents/data you
    want to process, what to achieve and you're knowledge in scripting vs.
    xslt. i use xmlRules for styling my documents, xslt for data transformation.
    in general you've got more control, especially over the rendered
    document, using xmlRules. if you want to process layout rules/guidelines
    in dependency of the actual document you have to render it first.
    complex data transformation and composition is better with xslt outside
    of indesign. i prefer to prepare my data (select relevant data,
    numbering, ...) with xslt.
    cheers,
    gregor

  • Transforming XML data into SVG line charts

    Hi
    I am trying to transform revenue data from an XML file into an SVG line chart. The problem is that I am quite new to XPath and XSLT and whereas I can draw the grid for my chart I struggle drawing the lines using the data from the XML doc.
    The XML look something like the one below, and I would like to have one chart for each product and in each chart having the time on the x-axis and chart the revenue by regions.
    Any help on this is much appreciated.
    Thanks
    Peter
    <?xml version="1.0"?>
    <revenue>
    <caption>
    <heading>My title</heading>
    </caption>
    <date name="01/01/2003">
    <region name="Asia">
    <product_a>30</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    </date>
    <date name="02/01/2003">
    <region name="Asia">
    <product_a>32</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>57</product_a>
    <product_b>31</product_b>
    <product_c>457</product_c>
    </region>
    </date>
    <date name="03/01/2003">
    <region name="Asia">
    <product_a>38</product_a>
    <product_b>12</product_b>Long postings are being truncated to ~1 kB at this time.

    Instead of using SVG charting can I suggest that you look into digital charts. This service creates charts on the fly and is very easy to integrate with web applications.
    Christopher
    www.billboard.net

  • Problem in transforming xml data to HTML

    Hai all,
    I am new to J developer, I have generated XML data to transform to HTML.
    Below is my xsql file with the name 'simpleqry.xsql'
    <?xml version='1.0' ?>
    <page xmlns:xsql="urn:oracle-xsql" connection="java:comp/env/jdbc/testDS">
    <xsql:query max-rows="-1" tag-case="lower" null-indicator="no">SELECT EMPNO,ENAME,SAL FROM EMP WHERE SAL &gt;= 5000</xsql:query>
    </page>
    it is producing the XML datas
    Further I need to convert it into HTML
    so I generated xsl stylesheet in under META-INF with the name 'EmpDetails.xsl'
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output encoding="ISO-8859-1" method="text/html" />
    <xsl:template match="/page">
    <html>
    <head>
    <title>Employee Results</title>
    </head>
    <body>
    <H2> EMPLOYEE QUERY RESULTS</H2>
    <h5><em> Following demonstrates XSQL query</em></h5>
    <table border="1" cellspacing="1" align="center">
    <tr bgcolor=" #F9F0C1">
    <th>EMP ID</th>
    <th>EMPLOYEE NAME</th>
    <th>SALARY</th>
    </tr>
    <xsl:for-each select="ROWSET/ROW">
    <tr>
    <td><xsl:value-of select="EMPNO"/></td>
    <td><xsl:value-of select="ENAME"/></td>
    <td><xsl:value-of select="SAL"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    next I have added the following to simpleqry.xsql
    <?xml-stylesheet type="text/xsl" href="EmpResults.xsl" ?>
    so my simpleqry.xsql file look like this
    <?xml version='1.0' ?>
    <?xml-stylesheet type="text/xsl" href="C:\JDeveloper\mywork\Application1\querysql\public_html\WEB-INF\EmpDetails.xsl" ?>
    <page xmlns:xsql="urn:oracle-xsql" connection="java:comp/env/jdbc/testDS">
    <xsql:query max-rows="-1" tag-case="lower" null-indicator="no">SELECT EMPNO,ENAME,SAL FROM EMP WHERE SAL &gt;= 5000</xsql:query>
    </page>
    when I rerun my simpleqry.xsql file it not generating the output .
    My J developer version is 'Oracle IDE 11.1.2.0.38.60.17'
    I know I made it lengthy. I made it clear so that you can understand my problem clearly. Please explain me how to solve the above mentioned problem(To generate HTML from XML data)
    Thanks in advance.
    Regards,
    Uraja

    next I have added the following to simpleqry.xsql
    +<?xml-stylesheet type="text/xsl" href="EmpResults.xsl" ?>+
    so my simpleqry.xsql file look like this
    +<?xml version='1.0' ?>+
    +<?xml-stylesheet type="text/xsl" href="C:\JDeveloper\mywork\Application1\querysql\public_html\WEB-INF\EmpDetails.xsl" ?>+
    What is added is different from what is listed in the XSQL, the xsl is different, the path to xsl is different.
    Specify relative path for xsl.

  • Recursively Merging 2 XML files with XSLT

    Hi there, I'm having a problem with merging a couple of XML files. I've found a few examples of merging on-line but none that really help.
    Basically I have an XML file which is written out by my Java program that looks something like this:
    <alldata>
       <data val="xx">
          <data val="yy">
             <data val="ss"></data>
          </data>
       <data val="gg"></data>
    </alldata>The number of children and siblings can change by the way.
    Therefore in the XSLT document I'm displaying the data recursively, i.e.
    <tr><td><xsl:value-of select="@val"/></td></tr>
    <xsl:for-each select="*">
       <xsl:call-template name="itself"></xsl:call-template>
    </xsl:for-each>This all works fine, but I now need to do a side by side comparison with another XML document that has exactly the same structure, but could have different values. I'm not sure how to do this, perhaps using the same recursive code and using a sort of pointer to where you are in the 2nd XML file (see below), but I've no idea how to go about this?
    <tr><td><xsl:value-of select="@val"/></td>
           <td><xsl:value-of select="<2nd documents @val>"/></td>
    </tr>
    <xsl:for-each select="*">
       <xsl:call-template name="itself"></xsl:call-template>
    </xsl:for-each>Output:
    xx    xy
    yy    yy
    ss   ss
    gg   hhDoes anybody have any suggestions or help on how to achieve this?
    Cheers
    Dan

    I posted the same question on the xsl-list message list and got a working solution - here it is in case anyone else has the same problem:
    <xsl:variable name="a" select="document('doc1.xml')//data"/>
    <xsl:variable name="b" select="document('doc2.xml')//data"/>
    <xsl:template match="/">
         <table>
           <xsl:for-each select="$a">
             <xsl:variable name="p" select="position()"/>
             <tr>
               <td><xsl:value-of select="@val"/></td>
               <td><xsl:value-of select="$b[$p]/@val"/></td>
             </tr>
           </xsl:for-each>
         </table>
    </xsl:template>Cheers
    Dan

  • Problem when decrypting an encrypted xml data with arabic data

    Hi all
    I have problem in decryption an encrypted Xml file. because my Xml file contains utf-8 characters, this problem occurs. after many proccess on Xml data the following code throws an Exception:
    try {
    // Works if the content is a single child element.
    byte [] a = decbit.getBytes("UTF-8");
    ByteArrayInputStream bais2 = new ByteArrayInputStream(a);
    Document decdoc = docBuilder.parse(bais2);
    Node decNode =
    encDoc.importNode(decdoc.getFirstChild(), true);
    edata.getParentNode().replaceChild(decNode,edata);
    }catch(org.xml.sax.SAXParseException spe) {
    //In case the content is plain text
    //or a group of child elements
    Text decText = encDoc.createTextNode(decbit);
    edata.getParentNode().replaceChild(decText,edata);
    decString = (getString((XmlDocument)encDoc));
    at the line with code "Document decdoc = docBuilder.parse(bais2); " an Exception occurs with message :
    org.xml.sax.SAXParseException: Illegal character at end of document, &#x3c;.
    whereas when I debug the project the filed "decbit", contains correct data. any way, in order to the exception, the control move to "catch" block and create a Text Node but the problem is the replaced data is like this:
    <id root="588588588" extension="" displayable="false" /><beneficiaryOf typeCode="BEN">
    <policyOrAccount classCode="COV" moodCode="EVN">
    <id xsi:type="II" root="855855855" extension="" displayable="false" />
    <author typeCode="AUT">
    <carrierRole classCode="UNDWRT">
    <id root="6548888888" extension="" displayable="false" />
    </carrierRole>
    </author>
    </policyOrAccount>
    </beneficiaryOf>
    as you can see, tha "<" characters are < and the ">" characters are >
    this really exhausted me, please help me out.
    thank you, any help will be appreciated
    regards
    Mohammad

    Hi Naveen,
    In sxmb_moni the content transmitted to the adapter(RFC)is as follows
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns:ZRFID_EQUIP xmlns:ns="urn:sap-com:document:sap:rfc:functions">
    - <RECORDS>
    - <item>
      <FLOC>f1-01-01</FLOC>
      <RFID_NO>I006</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-02</FLOC>
      <RFID_NO>I002</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-03</FLOC>
      <RFID_NO>I003</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-04</FLOC>
      <RFID_NO>I004</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-05</FLOC>
      <RFID_NO>I005</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-06</FLOC>
      <RFID_NO>I001</RFID_NO>
      </item>
      </RECORDS>
      </ns:ZRFID_EQUIP>
    At r/3 side the field floc and rfid_no gets mapped to floc which is of char30
    eg floc=f1-01-01I006
       rfid_no=

  • Problem inserting and querying XML data with a recursive XML schema

    Hello,
    I'm facing a problem with querying XML data that is valid against a recursive XML Schema. I have got a table category that stores data as binary XML using Oracle 11g Rel 2 on Windows XP. The XML Schema is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="bold_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="keyword_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
                   <xs:element name="plain_text" type="xs:string"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="emph_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="text_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="parlist_type">
              <xs:sequence>
                   <xs:element name="listitem" minOccurs="0" maxOccurs="unbounded" type="listitem_type"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="listitem_type">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="parlist" type="parlist_type"/>
                   <xs:element name="text" type="text_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:element name="category">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name"/>
                        <xs:element name="description">
                                  <xs:complexType>
                                            <xs:choice>
                                                           <xs:element name="text" type="text_type"/>
                                                           <xs:element name="parlist" type="parlist_type"/>
                                            </xs:choice>
                                  </xs:complexType>
                        </xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute name="id"/>
                                            </xs:complexType>
                        </xs:element>
    </xs:schema>I registered this schema and created the category table. Then I inserted a new row using the code below:
    insert into category_a values
    (XMlElement("category",
          xmlattributes('categoryAAA' as "id"),
          xmlforest ('ma categ' as "name"),
          (xmlelement("description", (xmlelement("text", 'find doors blest now whiles favours carriage tailor spacious senses defect threat ope willow please exeunt truest assembly <keyword> staring travels <bold> balthasar parts attach </bold> enshelter two <emph> inconsiderate ways preventions </emph> preventions clasps better affections comes perish </keyword> lucretia permit street full meddle yond general nature whipp <emph> lowness </emph> grievous pedro')))    
    The row is successfully inserted as witnessed by the results of row counting. However, I cannot extract data from the table. First, I tried using SqlPlus* which hangs up and quits after a while. I then tried to use SQL Developer, but haven't got any result. Here follow some examples of queries and their results in SQL Developer:
    Query 1
    select * from category
    Result : the whole row is returned
    Query 2
    select xmlquery('$p/category/description' passing object_value as "p" returning content) from category
    Result: "SYS.XMLTYPE"
    now I tried to fully respect the nested structure of description element in order to extract the text portion of <bold> using this query
    Query 3
    select  xmlquery('$p/category/description/text/keyword/bold/text()' passing object_value as "p" returning content) from  category_a
    Result: null
    and also tried to extract the text portion of element <text> using this query
    Query 4
    select  xmlquery('$p/category/description/text/text()' passing object_value as "p" returning content) from  category_a
    Result: "SYS.XMLTYPE".
    On the other hand, I noticed, from the result of query 1, that the opening tags of elements keyword and bold are encoded as the less than operator "&lt;". This explains why query 3 returns NULL. However, query 4 should display the text content of <text>, which is not the case.
    My questions are about
    1. How to properly insert the XML data while preserving the tags (especially the opening tag).
    2. How to display the data (the text portion of the main Element or of the nested elements).
    The problem about question 1 is that it is quite unfeasible to write a unique insert statement because the structure of <description> is recursive. In other words, if the structure of <description> was not recursive, it would be possible to embed the elements using the xmlelement function during the insertion.
    In fact, I need to insert the content of <description> from a source table (called category_a) into a target table (+category_b+) automatically .
    I filled category_a using the Saxloader utility from an flat XML file that I have generated from a benchmark. The content of <description> is different from one row to another but it is always valid with regards to the XML Schema. The data is properly inserted as witnessed by the "select * from category_a" instruction (500 row inserted). Besides, the opening tags of the nested elements under <description> are preserved (no "&lt;"). Then I wrote a PL/SQL procedure in which a cursor extracts the category id and category name into varchar2 variables and description into an XMLtype variable from category_a. When I try to insert the values into a category_b, I get the follwing error:
    LSX-00213: only 0 occurrences of particle "text", minimum is 1which tells that the <text> element is absent (actually it is present in the source table).
    So, my third question is why are not the tags recognized during the insertion?
    Can anyone help please?

    Hello,
    indded, I was using an old version of Sqlplus* (8.0.60.0.0) because I had a previous installation (oracle 10g XE). Instead, I used the Sqlplus* shipped with the 11g2database (version 11.2.0.1.0). All the queries that I wrote work fine and display the data correctly.
    I also used the XMLSERIALIZE function and can now display the description content in SQL Developer.
    Thank you very much.
    To answer your question Marco, I registered the XML Schema using the following code
    declare
      doc varchar2(4000) := '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="bold_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="keyword_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
                   <xs:element name="plain_text" type="xs:string"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="emph_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="text_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="parlist_type">
              <xs:sequence>
                   <xs:element name="listitem" minOccurs="0" maxOccurs="unbounded" type="listitem_type"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="listitem_type">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="parlist" type="parlist_type"/>
                   <xs:element name="text" type="text_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:element name="category">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name"/>
                        <xs:element name="description">
                                  <xs:complexType>
                                            <xs:choice>
                                                           <xs:element name="text" type="text_type"/>
                                                           <xs:element name="parlist" type="parlist_type"/>
                                            </xs:choice>
                                  </xs:complexType>
                        </xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute name="id"/>
                                            </xs:complexType>
                        </xs:element>
    </xs:schema>';
    begin
      dbms_xmlschema.registerSchema('/xmldb/category_auction.xsd', doc,     LOCAL      => FALSE, 
            GENTYPES   => FALSE,  GENBEAN    => FALSE,   GENTABLES  => FALSE,
             FORCE      => FALSE,
             OPTIONS    => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
             OWNER      => USER);
    end;then, I created the Category table as follows:
    CREATE TABLE category_a of XMLType XMLTYPE store AS BINARY XML
        XMLSCHEMA "xmldb/category_auction.xsd" ELEMENT "category";Now, there still remains a problem of how to insert the "description" content which I serialized as a CLOB data into another table as XML. To this purpose, I wrote a view over the Category_a table as follows:
    CREATE OR REPLACE FORCE VIEW "AUCTION_XWH"."CATEGORY_V" ("CATEGORY_ID", "CNAME", "DESCRIPTION") AS
      select category_v."CATEGORY_ID",category_v."CNAME",
      XMLSerialize(content ( xmlquery('$p/category/description/*' passing object_value as "p" returning content)) as clob) as "DESCRIPTION"
      from  auction.category_a p, 
    xmltable ('$a/category' passing p.Object_Value as "a"
    columns  category_id varchar2(15) path '@id',
              cname varchar2(20) path 'name') category_v;Then, I wrote a procedure to insert data into the Category_xwh table (the source and target tables are slightly different: the common elements are just copied wereas new elements are created in the target table). The code of the procedure is the following:
    create or replace PROCEDURE I_CATEGORY AS
    v_cname VARCHAR2(30);
    v_description clob ;
    v_category_id VARCHAR2(15);
    cursor mycursor is select category_id, cname, description from category_v;
    BEGIN
    open mycursor;
      loop
      /*retrieving the columns*/
      fetch mycursor into v_category_id, v_cname, v_description ;
      exit when mycursor%notfound;
      insert into category_xwh values
      (XMlElement("category",
          xmlattributes(v_category_id as "category_id"),
          xmlelement("Hierarchies", xmlelement("ObjHierarchy", xmlelement ("H_Cat"),
                                                               xmlelement ("Rollsup",
                                                                                  (xmlelement("all_categories",
                                                                                   xmlattributes('allcategories' as "all_category_id")))
        xmlforest (
                  v_cname as "cat_name",
                  v_description as "description")    
    end loop;
      commit;
      close mycursor;
    END I_CATEGORY;When I execute the procedure, I get the following error:
    LSX-00201: contents of "description" should be elements onlyso, I just wonder if this is because v_description is considered as plain text and not as XML text, even if its content is XML. Do I need to use a special function to cast the CLOB as XML?
    Thanks for your help.
    Doulkifli

  • XML data with nested repeating nodes

    First let me prelude with my skill set; "I am an XML,
    JavaScript and Spry newbie". My xml data looks like this:
    <report>
    <header>
    <column type="[string|real|int]>some
    value</column>
    <column type="[string|real|int]>some
    value</column>
    </header>
    <details>
    <row>
    <cell type="[string|real|int]">some value</cell>
    <cell type="[string|real|int]">some value</cell>
    </row>
    <row>
    <cell type="[string|real|int]">some value</cell>
    <cell type="[string|real|int]">some value</cell>
    </row>
    </details>
    </report>
    - report/header/column is completely dynamic and not known in
    advance
    - each report/header/column is the table column name value
    - each report/details/row/cell is the table cell value
    - type="[string|real|int]" is data type of the cell value
    Using Spry 1.5 I have been able to successfully populate the
    table column header row dynamically and repeat the appropriate
    number of rows.
    Spry is Cool!
    I have not been able to figure out how to repeat
    report/details/row/cell for each repeating row node. If I nest
    spry:repeat it appears to go into an endless loop.
    I will also need to equate data type to a Spry data type so
    that I may sort the columns appropriately for their respective data
    type.
    Here is the code I have so far:
    <script language="JavaScript" type="text/javascript"
    src="includes/xpath.js"></script>
    <script language="JavaScript" type="text/javascript"
    src="includes/SpryData.js"></script>
    <script language="JavaScript" type="text/javascript"
    src="includes/SpryNestedXMLDataSet.js"></script>
    <script type="text/javascript">
    var dsReport = new
    Spry.Data.XMLDataSet("data/cmbcov_raw.xml", "/iqreport");
    var dsHeaders = new Spry.Data.NestedXMLDataSet(dsReport,
    "header/column");
    var dsRows = new Spry.Data.NestedXMLDataSet(dsReport,
    "details/row");
    var dsCells = new Spry.Data.NestedXMLDataSet(dsReport,
    "details/row/cell");
    Spry.Data.Region.debug = true;
    </script>
    <link href="/report/css/samples.css" rel="stylesheet"
    type="text/css" media="all" />
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Reports</title>
    </head>
    <body>
    <h3
    spry:region="dsReport">{dsReport::@title}</h3>
    <div class="liveSample" spry:region="dsReport dsHeaders
    dsRows dsCells">
    <table class="dataTable">
    <tr>
    <th
    spry:repeat="dsHeaders">{dsHeaders::column}</th>
    </tr>
    <tbody>
    <tr spry:repeat="dsRows">
    <td>{dsCells::cell}</td> <!--if I use
    spry:repeat here browser hangs - endless loop?-->
    </tr>
    </tbody>
    </table>
    </div>
    </body>
    </html>
    Your assistance will be greatly appreciated!
    Thank you in advance,
    nomadcanuck

    Don,
    Thanks for forcing me to read the nested data set sample
    again, three times the charm as they say :). I made the following
    addition to get it to work.
    var dsDetails = new Spry.Data.NestedXMLDataSet(dsReport,
    "details");
    var dsRows = new Spry.Data.NestedXMLDataSet(dsDetails,
    "row");
    var dsCells = new Spry.Data.NestedXMLDataSet(dsRows, "cell");
    <tbody spry:repeat="dsDetails">
    <tr spry:repeat="dsRows">
    <td spry:repeat="dsCells">{dsCells::cell}</td>
    </tr>
    </tbody>
    I am still stumped with respect to sorting the dynamic
    header/column. Any chance of being pointed in the right direction,
    either document or hint is appreciated.
    Thanks again,
    nomadcanuck

  • How to get & use xml data with jstl libraries? (URGENT PLZ)

    I am using jstl to get and use xml data
    I needs to perform operations on the parsed xml document with other libraries of jstl. How can i do that.
    I used Dom variable to parse my document as:
    <x:parse varDom="test"> <c:import url="project.xml"/> </x:parse>
    where my project.xml is:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <project>      <projectName>myProject</projectName> </project>
    I can dislay this value in html by
    <x:out select="$test/project/projectName"/>
    But I need a string value sotred in variable such as <c:set var="pname" value="???">
    HOW CAN I SET THIS VALUE IN CORE VARIABLE THAT IS, USING <c:set...> SO THAT IT CAN BE USED ANYWHERE IN JSP PAGE TO CONCATE RETURNED STRING IN OTHER STRING VARIABLES DEFINED BY CORE LIB?
    Jessy
    Message was edited by:
    jessy
    Message was edited by:
    jessy

    I believe that <c:set> should do that but i am facing problem in it. Look into this jsp scriptlet:
    1-<x:parse varDom="test"> <c:import url="project.xml"/> </x:parse>
    2-<x:set var="ds" select="$test/project/projectName"/>
    3-<x:out select="$ds"/> <br>
    4-<c:set var="tt" value="${ds}" />
    5-<c:out value="${tt}" />
    In line 3 variable ds returns: myProject
    In line 5 variable tt returns: [[projectName: null]]
    perhaps on line 4 ds is storing some array to tt and i am not calling correct array element. I tried many options but still could not find solution. Plz Plz do something urgent for me. Thanks
    Jessy
    Message was edited by:
    jessy

  • C# load xml data with attributes to datagridview; update data and save back to the xml

    Hi guys,
    i currently have this XML as data
    <DEALS>
    <DEAL ID="22" ISBN="0-7888-1623-3" Screenplay="Mary Kaplan" Title ="Mr Gentleman" Director = "Jonathan Jones">
    <ALLOCATION DEMANDE="5000" CODE="72" PRICE="25.00">2500</ALLOCATION>
    <ALLOCATION DEMANDE="7000" CODE="75" PRICE="35.00">4000</ALLOCATION>
    </DEAL>
    <DEAL ID="23" ISBN="1-7988-1623-3" Screenplay="Joe Doe" Title ="Nothing Much" Director = "Listentome">
    <ALLOCATION DEMANDE="3300" CODE="72" PRICE="15.00">2500</ALLOCATION>
    </DEAL>
    </DEALS>
    I load the data with the code below:
    i use xDocument to load the DealData.xml and then put it in ToString.
    //outside of the form
    public static class XElementExtensions
    public static DataTable ToDataTable(this XElement element)
    DataSet ds = new DataSet();
    string rawXml = element.ToString();
    ds.ReadXml(new StringReader(rawXml));
    return ds.Tables[0];
    public static DataTable ToDataTable(this IEnumerable<XElement> elements)
    return ToDataTable(new XElement("Root", elements));
    //in the form
    private void button2_Click(object sender, EventArgs e)
    var xDocument = XDocument.Load("DealData.xml");
    string txtxml = xDocument.ToString();
    StringReader reader = new StringReader(txtxml);
    XDocument doc1 = XDocument.Load(reader);
    var res = doc1.Descendants("DEAL").ToList().Where(x => x.Attribute("ID").Value == "22").Descendants("ALLOCATION");
    dataGridView1.DataSource = res.ToDataTable();
    Now my question is:
    I would like to update the data from the DataGridview with the Attribute("ID").Value == "22" and save the data back to the XML.
    For example, after I load my data on the datagridview, we only pickup anything that is in the node
    <DEAL ID="22" ISBN="0-7888-1623-3" Screenplay="Mary Kaplan" Title ="Mr Gentleman" Director = "Jonathan Jones">
    <ALLOCATION DEMANDE="5000" CODE="72" PRICE="25.00">2500</ALLOCATION>
    <ALLOCATION DEMANDE="7000" CODE="75" PRICE="35.00">4000</ALLOCATION>
    </DEAL>
    I updated the datagridview below with DEMANDE = 9000 CODE = 66 PRICE = 24.77 AND ALLOCATION = 1200
    I want be able to extract the data back in the xml as a child of the DEAL ID = "22"
    So that the XML file looks like this 
    <DEALS>
    <DEAL ID="22" ISBN="0-7888-1623-3" Screenplay="Mary Kaplan" Title ="Mr Gentleman" Director = "Jonathan Jones">
    <ALLOCATION DEMANDE="5000" CODE="72" PRICE="25.00">2500</ALLOCATION>
    <ALLOCATION DEMANDE="7000" CODE="75" PRICE="35.00">4000</ALLOCATION>
    <ALLOCATION DEMANDE="9000" CODE="66" PRICE="24.77">1200</ALLOCATION> <-! this is the new line !->
    </DEAL>
    <DEAL ID="23" ISBN="1-7988-1623-3" Screenplay="Joe Doe" Title ="Nothing Much" Director = "Listentome">
    <ALLOCATION DEMANDE="3300" CODE="72" PRICE="15.00">2500</ALLOCATION>
    </DEAL>
    </DEALS>
    Is there a way to achieve that?
    I have been searching and reading in the books but i cannot find a solution for this.
    Thank you
    Please do not forget to click “Vote as Helpful” if the reply helps/directs you toward your solution and or "Mark as Answer" if it solves your question. This will help to contribute to the forum.

    I would think of something like the below, the id is passed as static you need to change this
    protected virtual void button1_Click(object sender, EventArgs e)
    //Get DataTable from DGV datasource
    DataTable dt = new DataTable();
    dt = (DataTable)dataGridView1.DataSource;
    string file1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><DEALS><DEAL ID=\"22\" ISBN=\"0-7888-1623-3\" Screenplay=\"Mary Kaplan\" Title =\"Mr Gentleman\" Director = \"Jonathan Jones\"><ALLOCATION DEMANDE=\"5000\" CODE=\"72\" PRICE=\"25.00\">2500</ALLOCATION><ALLOCATION DEMANDE=\"7000\" CODE=\"75\" PRICE=\"35.00\">4000</ALLOCATION></DEAL><DEAL ID=\"23\" ISBN=\"1-7988-1623-3\" Screenplay=\"Joe Doe\" Title =\"Nothing Much\" Director = \"Listentome\"><ALLOCATION DEMANDE=\"3300\" CODE=\"72\" PRICE=\"15.00\">2500</ALLOCATION></DEAL></DEALS>";
    StringReader reader = new StringReader(file1);
    XDocument doc1 = XDocument.Load(reader);
    //Remove all elements related to the id being populated into the Grid
    doc1.Descendants("DEAL").ToList().Where(x => x.Attribute("ID").Value == "22").Descendants("ALLOCATION").Remove();
    //loop through datatable and create new xelement to be added to the xdocument
    foreach (DataRow dr in dt.Rows)
    XElement xe = new XElement("ALLOCATION",
    new XAttribute("DEMANDE", dr[0].ToString()),
    new XAttribute("CODE", dr[1].ToString()),
    new XAttribute("PRICE", dr[2].ToString()));
    xe.Value = dr[3].ToString();
    doc1.Descendants("DEAL").ToList().Where(x => x.Attribute("ID").Value == "22").FirstOrDefault().Add(xe);
    Fouad Roumieh

  • Generate hierarchical xml data with xmlutilities ?

    hello
    I am just experimenting with the oracle xml utilities, because I
    want to set on http-services to access to our patient database.
    Is it possible to generate the following xml structure (ALL
    relevant diagnoses are hierarchically subordered to the ONE
    patient) when two tables (master table patient, dependent table
    diagnoses) are given ?
    <rowset>
    <row num=...>
    <name>smith</name>
    <diagnosis>
    <date> ...</date>
    <icd-code> ... </icd-code>
    <text> ... </text>
    </diagnosis>
    /*ev.further diagnosis*/
    </row>
    /*ev.further rows for further patients*/
    </rowset>
    By the moment, I have the impression that only list-similar xml
    data is possible.
    Thank You very much for comments.
    ali gerhard
    null

    Hi ali,
    Yes, you can use the CAST(MULTISET()) operator to create a
    nested table of subordered diagnostic record and display it.
    (You need the objects option installed if you are using 8.0.
    With 8i, the objects options is included free)
    e.g.
    /* Create a regular type */
    CREATE TYPE diagnostic_type AS OBJECt
    diag_date NUMBER,
    icd_code NUMBER,
    /* etc... all the necessary diagnostic details.. */
    /* create a nested table type */
    CREATE TYPE diagnostic_list_t AS TABLE OF diagnostic_type;
    /* Now u can use this in any query */
    SELECT p.name AS name,
    CAST(MULTISET( SELECT d.diag_date, d.icd_code,...
    FROM diagnosis_table d
    WHERE d.patient_name = p.name)
    AS diagnostic_list_t) AS diagnosis
    FROM patient_table p;
    This query as u can see gets the name of the patient and then
    creates a nested table of diagnostic records for the patient.
    This assumes that for every patient there are more than 1
    diagnosis records.
    If you have only one diagnostic record per patient then u can
    simply write this as,
    SELECT p.name AS name,
    diagnostic_t(d.diag_date,d.icd_code,...) AS diagnosis
    FROM patient_table p, diagnostic_table d
    WHERE p.name = d.patient_name;
    Here u are just constructing a structured diagnosis type from
    the given values.
    Hope this helps,
    Murali
    ali gerhard (guest) wrote:
    : hello
    : I am just experimenting with the oracle xml utilities, because
    I
    : want to set on http-services to access to our patient
    database.
    : Is it possible to generate the following xml structure (ALL
    : relevant diagnoses are hierarchically subordered to the ONE
    : patient) when two tables (master table patient, dependent
    table
    : diagnoses) are given ?
    : <rowset>
    : <row num=...>
    : <name>smith</name>
    : <diagnosis>
    : <date> ...</date>
    : <icd-code> ... </icd-code>
    : <text> ... </text>
    : </diagnosis>
    : /*ev.further diagnosis*/
    : </row>
    : /*ev.further rows for further patients*/
    : </rowset>
    : By the moment, I have the impression that only list-similar
    xml
    : data is possible.
    : Thank You very much for comments.
    : ali gerhard
    null

  • Problem in mapping xml data with header details from IPM 11g to BPEL

    Hi,
    I want to map xml data as a supporting content from IPM application to BPEL.
    My xml is
    <?xml version="1.0" encoding="utf-8"?>
    <DocumentFile xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/Document.xsd">
    <Document DocumentType="Invoice">
    <DocumentImage>
    <Filename>\\10.205.0.209\Img\10883212.TIF</Filename>
    </DocumentImage>
    </DocumentFile>
    If I remove header details from root element <DocumentFile> i.e. modified xml is
    <DocumentFile>
    <Document DocumentType="Invoice">
    <DocumentImage>
    <Filename>\\10.205.0.209\Img\10883212.TIF</Filename>
    </DocumentImage>
    </DocumentFile>
    it works fine but i need to pass header details as well.
    Please suggest.
    Thanks,
    Priya

    Hi Naveen,
    In sxmb_moni the content transmitted to the adapter(RFC)is as follows
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns:ZRFID_EQUIP xmlns:ns="urn:sap-com:document:sap:rfc:functions">
    - <RECORDS>
    - <item>
      <FLOC>f1-01-01</FLOC>
      <RFID_NO>I006</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-02</FLOC>
      <RFID_NO>I002</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-03</FLOC>
      <RFID_NO>I003</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-04</FLOC>
      <RFID_NO>I004</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-05</FLOC>
      <RFID_NO>I005</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-06</FLOC>
      <RFID_NO>I001</RFID_NO>
      </item>
      </RECORDS>
      </ns:ZRFID_EQUIP>
    At r/3 side the field floc and rfid_no gets mapped to floc which is of char30
    eg floc=f1-01-01I006
       rfid_no=

Maybe you are looking for