Nested XML from recordset problems.

Hi
I have been struggling with this for a while now and desperatley need som help!
I'm trying to create a nested spryregion that looks like this:'
http://www.soulkompetens.se/utbildningar.php#
Problem with that page is that it only works in Safari (mac). Firefox the encoding does not work (questionmarks instead of åäö).
Windows explorer does not work at all .
So I started to work wit the http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html page to try to generate the xml.
The XML should be something like:
<DOCUMENT>
  <ROW0>
    <UTBILDNING_ID>22</UTBILDNING_ID>
    <RUBRIK>Värdegrunden som bas för affärsutveckling</RUBRIK>
    <ROW1>
      <INGRESS>Värdegrunden som bas för affärsutveckling, diskrimineringsgrunderna</INGRESS>
      <ID>17</ID>
     <TEXT></TEXT>
      <DATUM>0000-00-00</DATUM>
    </ROW1>
    <ROW1>
      <INGRESS>Västra Götaland 3:e september</INGRESS>
      <ID>34</ID>
      <TEXT></TEXT>
      <DATUM>2009-06-21</DATUM>
    </ROW1>
  </ROW0>
  <ROW0>
    <UTBILDNING_ID>25</UTBILDNING_ID>
    <RUBRIK>Omvärldsanalys</RUBRIK>
    <ROW1>
      <INGRESS>Mellersta Norrland 11:e december</INGRESS>
      <ID>35</ID>
      <TEXT></TEXT>
      <DATUM>0000-00-00</DATUM>
    </ROW1>
</ROW0>
</DOCUMENT>
I get the XML from two joined Tables in the database.
Sql looks like:
select utbildning_rubrik.utbildning_id, utbildning_rubrik.rubrik, utbildning.ingress, utbildning.ID, utbildning.text, utbildning.datum
from utbildning_rubrik, utbildning where utbildning_rubrik.utbildning_id = utbildning.utbildning_id
order by utbildning_rubrik.utbildning_id, utbildning.ingress
Now! How do I generate the XML with "query to xml".
I have been trying a lot of things an my head is spinning around
Can anybody help me please.
Regards
Olle

Thank you for the answer.
I think I am close. But there is something wrong wit the nesting of the nodes and repeating.
Here is the code:
<?php
mysql_select_db($database_SOUL, $SOUL);
$query_rsImages = "SELECT utbildning_rubrik.utbildning_id, utbildning_rubrik.rubrik, utbildning.ingress, utbildning.ID, utbildning.text, utbildning.datum FROM utbildning_rubrik, utbildning WHERE utbildning_rubrik.utbildning_id = utbildning.utbildning_id ORDER BY utbildning_rubrik.utbildning_id, utbildning.ingress";
$rsImages = mysql_query($query_rsImages, $SOUL) or die(mysql_error());
$row_rsImages = mysql_fetch_assoc($rsImages);
$totalRows_rsImages = mysql_num_rows($rsImages);
// Send the headers
header('Content-type: text/xml');
header('Pragma: public');       
header('Cache-control: private');
<?php echo('<?xml version="1.0" encoding="ISO-8859-1"?>'); ?>
<DOCUMENT>
  <?php if ($totalRows_rsImages > 0) { // Show if recordset not empty ?>
    <ROW0>
    <UTBILDNING_ID><?php echo $row_rsImages['utbildning_id']; ?></UTBILDNING_ID>
    <?php do { ?><RUBRIK><?php echo $row_rsImages['rubrik']; ?>
  <ROW1>
        <?php do { ?><INGRESS><?php echo $row_rsImages['ingress']; ?></INGRESS>
        <TEXT><![CDATA[<?php echo $row_rsImages['text']; ?>]]></TEXT><?php } while ($row_rsImages = mysql_fetch_assoc($rsImages)); ?>
        </ROW1>
        </RUBRIK><?php } while ($row_rsImages = mysql_fetch_assoc($rsImages)); ?>
        </ROW0>
   <?php } // Show if recordset not empty ?>
</DOCUMENT>
In the other php document consuming the xml I have
ds1.setColumnType("RUBRIK", "html");
So the main problem with this is I dont know php so good that I can repeat the nodes to my choise.
I neew it to be
ROW0>
  <UTBILDNING_ID></UTBILDNING_ID>
  <RUBRIK></RUBRIK>
  <ROW1>
    <INGRESS></INGRESS>
    <TEXT></TEXT>
    <DATUM>/DATUM>
  </ROW1>
  <ROW1>
    <INGRESS></INGRESS>
    <TEXT></TEXT>
    <DATUM></DATUM>
  </ROW1>
</ROW0>
<ROW0>
  <UTBILDNING_ID></UTBILDNING_ID>
  <RUBRIK></RUBRIK>
  <ROW1>
    <INGRESS></INGRESS>
   <ID></ID>
    <TEXT></TEXT>
    <DATUM></DATUM>
  </ROW1>
  </ROW1>
</ROW0>
Can you help?
Regards
Olle

Similar Messages

  • Generating Deeply nested XML from a flat file

    Hi All,
    I am working on a MQ to IDOC scenario.
    I am getting a flat file as input. I need to convert it into XML( so that XI can understand it).
    But conversion is into a "Deeply Nested XML from a Flat File" at sender side (JMS Adapter).
    Any inputs on this.
    Regards,
    Vikas

    You can only convert flat file into xml structure with 3 levels.
    If you need to convert flat file into deep nested xml structure, you have to do java mapping or xslt or abap mapping. There is a tool, I think it's called conversion agent by itemfield (bought by SAP), which can do pretty everything with conversion. Never used it though.
    Jayson

  • How to generate nested xml from a resultset

    there is a table which contains two field:key and fatherkey.
    like this:
    key fatherkey
    node1 root
    node2 node1
    node3 node2
    a tree can be builded from the table by recursion of key and fatherkey.
    now I want to use this table to generate a xml buffer.
    like this:
    <nodes>
    <node>
    <key>node1</key>
    <fkey>root</fkey>
    <node>
    <key>node2</key>
    <fkey>node1</fkey>
    <node>
    <key>node3</key>
    <fkey>node2</fkey>
    </node>
    </node>
    </node>
    </nodes>
    if oracle special sql --"Connect by" can be used ,it is so easy.
    but I can only use ansi sql.
    how to generate the xml?

    hehe, I solved it by JDom!
    source code is :
    public StringBuffer loadInitResource()
    Vector theOrphans = new Vector();
    StringBuffer theInitRes = new StringBuffer();
    Element root = new Element("NODES");
    String xsql = "SELECT KEY,FATHERKEY FROM TABLE1";
    ResultSete m_rs = stmt.executeQuery(xsql);
    try{
    while(m_rs.next())
    Element theNode = new Element("NODE");
    Element theFLD = new Element("ID");
    theFLD.addContent(m_rs.getString(1));
    theNode.addContent(theFLD);
    theFLD = new Element("SID");
    theFLD.addContent(m_rs.getString(2));
    theNode.addContent(theFLD);
    if("Root".equals(theNode.getChildText("SID").trim()))
    root.addContent(theNode);
    else if(x_setFatherRes(theNode, root))
    System.out.println("find");
    else
    theOrphans.addElement(theNode);
    Element theNode;
    int nIndex;
    boolean isDo = false;
    while(theOrphans.size()>0)
    System.out.println("find the orphan!");
    isDo = false;
    for(nIndex = 0;nIndex < theOrphans.size();nIndex++)
    theNode = (Element) theOrphans.get(nIndex);
    if(x_setFatherRes(theNode, root))
    theOrphans.remove(nIndex);
    isDo = true;
    System.out.println("found the orphan!");
    break;
    if(!isDo)
    System.out.println("some nodes could not be loaded!");
    break;
    //OutputStream out=new FileOutputStream("e:/XMLFile.xml");
    Document doc = new Document(root);
    XMLOutputter outputter = new XMLOutputter();
    outputter.setEncoding("GB2312");
    //outputter.output(doc,out);
    theInitRes = new StringBuffer(outputter.outputString(doc));
    catch(Exception e)
    m_error += e.toString() ;
    return theInitRes;
    private boolean x_setFatherRes(Element theSon,Element theFather)
    boolean isOK = false;
    String sFatherSID = theFather.getChildText("ID");
    if(sFatherSID != null)
    if(theSon.getChildText("SID").equals(sFatherSID.trim()))
    theFather.addContent(theSon);
    isOK = true;
    if(isOK)
    return isOK;
    Iterator iterator = theFather.getChildren().iterator();
    while(iterator.hasNext())
    Element theFather2 = (Element) iterator.next();
    isOK = x_setFatherRes(theSon,theFather2);
    if(isOK)
    break;
    return isOK;
    enjoy it!

  • Producing nested xml with querying attributes from a nested table

    How can one produce nested xml querying columns from a nested table? Looking at the object documentation, I can readily unnest the tables. Using your examples in the book, unnesting is select po.pono, ..., l.* from purchaseorder_objtab po, table (po.lineitemlist_ntab) l where l.quantity = 2;
    what if I don't want to unnest and don't want a cursor. I would like to produce nested xml.

    Gail,
    Although you can use XSU (XML-SQL Util) in 8.1.7, I would recommend that you upgrade to 9i for much better support (both in functionality and performance) of XML in the database. For example, in Oracle9i there are:
    - a new datatype - XMLType for storing and retrieving XML documents
    - DBMS_XMLGEN package and SYS_XMLGEN, SYS_XMLAGG functions for generating XML document from complex SQL queries
    - A pipelined table function to break down large XML documents into rows.
    You can check out some examples using SYS_XMLGEN and DBMS_XMLGEN for your specific needs at http://download-west.oracle.com/otndoc/oracle9i/901_doc/appdev.901/a88894/adx05xml.htm#1017141
    Regards,
    Geoff

  • Problem with send email to recipients From recordset behavior

    Hello
    I use the ^send email to recipients From recordset^ behavior, then words of the subject of  sent email stick and the spaces between words in subject removed.
    E-Mail charset is utf-8 and language is Persian
    for example:
    موضوع ايميل من
    will be change to:
    موضوعايميلمن
    notice: spaces are removed
    To overcome this problem, please help me
    sorry, i'm not good in english
    Thanks

    Persian language is very similar to arabic language
    Please help me, I can't solve this problem

  • Send E-mail To Recipients From Recordset Attachment problem

    Hello !
    I got a recordset which stored a list of recipients emails.
    CREATE TABLE IF NOT EXISTS `tasks` (
    `id_task` mediumint(9) NOT NULL auto_increment,
    `id_procedure` mediumint(9) NOT NULL,
    `id_step` mediumint(9) NOT NULL,
    `lib_task` varchar(40) NOT NULL,
    `recipient_email` varchar(80) default NULL, <---------------- email to use
    `email_text` mediumtext,
    `url_document` varchar(100) default NULL, <------------------ name of document to send for THIS recipient as attachement
    PRIMARY KEY (`id_task`),
    KEY `id_procedure` (`id_procedure`),
    KEY `id_step` (`id_step`)
    There's less than 10 records to process.
    Table content :
    RECIPIENT 1 DOCUMENT 1
    RECIPIENT 2 DOCUMENT 2
    RECIPIENT 3 DOCUMENT 3
    RECIPIENT 4 DOCUMENT 4
    RECIPIENT 5 DOCUMENT 5
    RECIPIENT 6 DOCUMENT 6
    I want to use the "Send E-mail to Recipients From Recordset" behaviour and Dynamic Datas.
    The problem is that each recipients are well processed but all of them receive the attach document of the FIRST one !
    Email results :
    RECIPIENT 1 DOCUMENT 1
    RECIPIENT 2 DOCUMENT 1
    RECIPIENT 3 DOCUMENT 1
    RECIPIENT 4 DOCUMENT 1
    RECIPIENT 5 DOCUMENT 1
    RECIPIENT 6 DOCUMENT 1
    How can I fix it ?
    Thanks for your help. Jérôme.

    I try another way to do it, using a html link
    > function Trigger_EmailRecordset_E6(&$tNG) {
    $rsemailObj = new tNG_EmailRecordset($tNG);
    $rsemailObj->setRecordset("rsTasks");
    $rsemailObj->setFrom("{KT_defaultSender}");
    $rsemailObj->setTo("email_to");
    $rsemailObj->setSubject("{rsTasks.lib_task}");
    //WriteContent method
    $rsemailObj->setContent("{rsTasks.email_text}\n</br>\n</br>\n{rsTasks.url_document}</br>< /br>
    <a href=\"http://xxx.xxx.xxx.xxx/yyyyyyyy/{rsTasks.url_document}\">Clic here</a>");
    $rsemailObj->setEncoding("UTF-8");
    $rsemailObj->setFormat("HTML/Text");
    $rsemailObj->setImportance("High");
    return $rsemailObj->Execute();
    I wonder if I could use Dynamic Data _INSIDE_ {rsTasks.email_text} field ?
    Thanks. JM.

  • Nested XML structure from Oracle

    Using the SQL Adapter i BizTalk, calling a SQL Stored procedure on a MS SQL DB, I can get a nice nested XML structure using p JOIN ii and FOR XML AUTO, like this
    <p code="DK003">
    <ii stamp="2013-01-14T10:27:38.790"value="180.702052"price="184.000000">
    <d Dividend="2.50"DividendDate="2012-03-29T00:00:00" />
    </ii>
    <ii stamp="2013-01-14T10:27:38.790"value="181.702052"price="14.000000">
    <d Dividend="2.50"DividendDate="2012-03-29T00:00:00" />
    </ii>
    </p>
    How can I get the same on Oracle ??

    Hi E.,
    I guess this an XML namespace issue. I'm creating XmlForms-style documents and had to add an XML namespace to my root element to make them visible as such:
    Namespace xf = Namespace.getNamespace("xf", "http://www.sapportals.com/wcm/app/xmlforms");
    root.addNamespaceDeclaration(xf);
    So what I'd suggest to you is reading out the IResource and treating the content as XML:
    Document document = new  SAXBuilder().build(content.getInputStream());
    Element root = document.getRootElement();
    Namespace xf = Namespace.getNamespace("xf", "http://www.sapportals.com/wcm/app/xmlforms");
    root.removeNamespaceDeclaration(xf);
    Hope this helps!
    regards,
    Christian

  • Exception in XML Parser (format problem?)

    Hi Experts,
    I am working on IDOC -> AS2 Configuration and the AS2 Configuration has the below structure
    <RecordSet>
         <Row1>
                       <row1 - field1>
                       <row1 - field2>
                       <row1 - field3>
         </Row1>
         <Row2>
                       <row2 - field1>
                       <row2 - field2>
                       <row2 - field3>
         </Row2>
         <Records>
              <Record1>
                        <Record1-Field1>
                        <Record1-Field1>
                        <Record1-Field1> 
              </Record1>
              <Record2>
                        <Record2-Field1>
                        <Record2-Field1>
                        <Record2-Field1> 
              </Record2>
         </Records>
    </RecordSet>
    We are getting the expected Structure when we AS2 Receiver has the xml format. But while doing module development with the strctxml2Plain, we are getting the below error  in RWB CC Monitoring.
    Message processing failed. Cause: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.NullPointerException''; nested exception caused by: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.NullPointerException'
    Any ideas, why this error we are getting.....
    Thanks in advance,
    Regards,
    Vasu

    Hi Vasu,
    Not in the Mapping of IR.
    In BIC Mapping Designer you have to test with the standard Mappings by providing the sample file whether the Conversion is happening correctly or not.
    You have to take the same input file that what ever you are having now.
    So that it will say clearly what is the problem in converting the XMLto the required EDI Format...
    Check whether you have any Date Format Values are comming from the input file.
    Regards
    Seshagiri

  • How to construct the where clause for a nested xml target file

    Post Author: jlpete72
    CA Forum: Data Integration
    I'm having some problems getting the desired results creating a multi-level nested xml file.  Specifically, it does not seem that the where clause in the child schemas respects values from parent schemas.  I'm sure I'm constructing something incorrectly, but am running out of ideas. 
    I am working with the classic company/order/line hierarchy and there are three levels of output schemas in my target xml file, one for company, order header and order line information.
    For testing, I have hardcoded a restriction at the order header line to deal with only one order.  But unless I hardcode values into the where clause at the order line level of the schema, all values are returned for orders belonging to the company defined in the company level.
    I'm trying a where clause at the order line level similar to:
    order_line.customer = order_header.customer and order_line.order_num = order_header.order_num
    If the customer has more than one order in the data file, then all orders for that customer are placed in the detail for the order header.  Only if I hard code the order number in the where clause do I get only the lines for the order specified in the header section.  Not very practical. 
    What am I missing?

    An External Parsed Entity could be used to reference a schema.
    In your DTD:
    <!ENTITY datamodules SYSTEM "file:///c:/Datamodules/Datamodules.xsd">
    Refer the external entity in xml document:
    <datamodules>&datamodules;</datamodules>

  • Nested XML with XSU

    I have data in an Oracle8i-database and will use Java to export
    it to XML. I&#8217;m trying to use XML Developer&#8217;s Kit&#8217;s (XDK&#8217;s) XML
    SQL Utility&#8217;s (XSU&#8217;s) OracleXMLQuery class. But I&#8217;ve problems to
    get the nested XML-structure I need!
    Oracle says there&#8217;s two good ways to do this:
    &#8220;Source Customization
    This category incompases customizations done by altering the
    query or the database schema. Among the simplest and the most
    powerful source customizations are:
    * over the database schema, create an object-relational view
    which maps to the desired XML document structure.
    * in your query, use cursor subqueries, or cast-multiset
    constructs to get nesting in the XML document which comes from a
    flat schema.&#8221;
    They then have an example how to create an object-relational
    view. But this is done with an empty database, and I already
    have tables with data so I don&#8217;t know how to do this.
    I&#8217;ve tried with some simple subqueris like
    SELECT name, id,
    (SELECT COUNT(*) FROM order o WHERE c.id = o.id) AS
    NumOfOrders
    FROM cust c
    But it adds just another colum.
    Could somebody help me or direct me to some resource, please?
    Thanks!

    I have data in an Oracle8i-database and will use Java to export
    it to XML. I&#8217;m trying to use XML Developer&#8217;s Kit&#8217;s (XDK&#8217;s) XML
    SQL Utility&#8217;s (XSU&#8217;s) OracleXMLQuery class. But I&#8217;ve problems to
    get the nested XML-structure I need!
    Oracle says there&#8217;s two good ways to do this:
    &#8220;Source Customization
    This category incompases customizations done by altering the
    query or the database schema. Among the simplest and the most
    powerful source customizations are:
    * over the database schema, create an object-relational view
    which maps to the desired XML document structure.
    * in your query, use cursor subqueries, or cast-multiset
    constructs to get nesting in the XML document which comes from a
    flat schema.&#8221;
    They then have an example how to create an object-relational
    view. But this is done with an empty database, and I already
    have tables with data so I don&#8217;t know how to do this.
    I&#8217;ve tried with some simple subqueris like
    SELECT name, id,
    (SELECT COUNT(*) FROM order o WHERE c.id = o.id) AS
    NumOfOrders
    FROM cust c
    But it adds just another colum.
    Could somebody help me or direct me to some resource, please?
    Thanks!

  • Nested XML data set

    Hi there,
    I have a problem with displaying some nested XML data. I've
    tried quite a lot of different approachey to this, but just can't
    get it working properly. So here's the deal:
    I have an XML file (which is dynamically created from a
    servlet) of the form:
    <variations>
    <variation>
    <name>...</name>
    <...>...</...>
    <links>
    <link>
    <type>...</type>
    <name>...</name>
    </link>
    </links>
    </variation>
    </variations>
    On my webpage, I use a Spry tabbed panel with one tab for
    each of the 'variation's in the XML file. Within the tabs I have
    (many) form fields dynamically filled with the values from the XML
    and that all works fine, but I also want to display a table with
    one row corresponding to each 'link'... and that just won't work...
    My latest approach looks something like this:
    <head>
    <script type="text/javascript">
    <!--
    var dsVariations = new
    Spry.Data.XMLDataSet("Servlet?id=1&cmd=getVariations",
    "variations/variation");
    var dsLinks = new
    Spry.Data.XMLDataSet("Servlet?id=0&cmd=getLinks",
    "links/link");
    //-->
    </script>
    </head>
    <body>
    <div id="TabbedPanels1" spry:region="dsVariations">
    <div id="TP1" class="TabbedPanels">
    <ul class="TabbedPanelsTabGroup">
    <li spry:repeat="dsVariations" class="TabbedPanelsTab"
    tabindex="0">{dsVariations::name}</li>
    </ul>
    <div class="TabbedPanelsContentGroup">
    <div spry:repeat="dsVariations"
    class="TabbedPanelsContent">
    // a lot of form stuff
    <table border="1">
    <script type="text/javascript">
    dsLinks.setURL("Servlet?id={dsVariations::id}&cmd=getLinks");
    dsLinks.loadData();
    </script>
    <tr spry:repeat="dsLinks">
    <td>{dsLinks::type}</td>
    <td>{dsLinks::name}</td>
    </tr>
    </tr>
    </table>
    </div>
    </div>
    </body>
    In this, the Servlet call with cmd=getVariations returns the
    whole XML stated above, while the cmd=getLinks will only get the
    corresponding part (everything between <links> and
    </links>).
    The error message I get for this is: processTokens() failed
    to get a data set context!.
    I previously tried to use a NestedXMLDataSet, but couldn't
    get that working either... I'm really kind of stuck by now and
    would appreciate any help.
    Thanks,
    Florian
    PS Thanks a lot for creating Spry: It's great!

    Thanks for your reply, Cristian.
    I'm afraid I couldn't do that since it would cause the whole
    region to be reloaded constantly (because it's being updated each
    time I do the setURL / loadData)... in fact, I tried this before
    and it didn't work.
    But, in fact, I figured that the fact that I could not get it
    running using a NestedXMLDataSet (as I would generally prefer), did
    not actually come down to a problem in the page source code, but
    actually to a problem with the very XML itself:
    I tried to recreate the simple nested data set example (
    http://labs.adobe.com/technologies/spry/samples/data_region/NestedDataSample.html)
    and basically used the same code and an almost identical XML
    structure... yet it doesn't work. The contents of dsFeatures just
    won't be displayed and when I'm inspecting the contents of
    dsFeatures (using Firebug) it shows me that the dataset is empty. I
    just don't get why it works for your example, but not for my
    modified version... I can't see any crucial difference :-s.
    To simplify the problem I deleted most tags from the XML and
    saved it in a static document "variations.xml":
    <variations>
    <variation>
    <name>Var 1</name>
    <features>
    <feature>none</feature>
    <feature>feat1</feature>
    <feature>feat2</feature>
    </features>
    </variation>
    <variation>
    <name>Var 2</name>
    <features>
    <feature>none</feature>
    </features>
    </variation>
    </variations>
    The source of the test page would be:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml"
    xmlns:spry="
    http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Nested Data Sample</title>
    <script language="JavaScript" type="text/javascript"
    src="SpryAssets/xpath.js"></script>
    <script language="JavaScript" type="text/javascript"
    src="SpryAssets/SpryData.js"></script>
    <script language="JavaScript" type="text/javascript"
    src="SpryAssets/SpryNestedXMLDataSet.js"></script>
    <script type="text/javascript">
    var dsVariations = new Spry.Data.XMLDataSet("variations.xml",
    "/variations/variation");
    var dsFeatures = new Spry.Data.NestedXMLDataSet(dsVariations,
    "features/feature");
    </script>
    </head>
    <body>
    <table border="1">
    <tr>
    <th width="30%"
    onclick="dsVariations.sort('name');">dsVariations</th>
    <th width="30%"
    onclick="dsFeatures.sort('link')">dsFeatures</th>
    <th width="30%">dsVariations + dsFeatures</th>
    </tr>
    <tr>
    <td valign="top"><div
    spry:region="dsVariations">
    <ul>
    <li spry:repeat="dsVariations" spry:select="select"
    spry:hover="hover" spry:setrow="dsVariations"> {name}
    </li>
    </ul>
    </div></td>
    <td valign="top"><div spry:region="dsFeatures">
    <ul>
    <li spry:repeat="dsFeatures"> {dsFeatures::feature}
    </li>
    </ul>
    </div></td>
    <td valign="top"><div spry:region="dsVariations
    dsFeatures">
    <ul>
    <li spry:repeat="dsVariations"> {dsVariations::name}
    <ul>
    <li
    spry:repeat="dsFeatures">{dsFeatures::feature}</li>
    </ul>
    </li>
    </ul>
    </div></td>
    </tr>
    </table>
    </body>
    Evidently, I'm missing some essential simple point here...
    Thanks,

  • Using Multiple Subpaths - question about nested XML data

    Hello.
    I am in the process of getting my head around the nested XML data that is one layer deeper than I know how to handle - ultimately I would like to populate a Spry MenuBar from the static XML file.
    Updates & revisions to the menu would be done by simply uploading a new XML file to the server whenever something needs changed.
    The problem I am having is in regard to more than one subpath.
    I can successfully get the "Menuheading" and the "items" to show but the "subitems" that should attach to the "items" are nowhere to be found. Once this is figured out, I will begin building my menu.
    I'm not getting an XML error when testing in Safari (Mac OS 10.5.8)
    I thing my problem lies here in the head section of the page - obviously somewhere in the subPaths area:
    <script type="text/javascript">var dsItems1 = new Spry.Data.XMLDataSet("MenuXML.xml", "/menu/menuitem", { subPaths: [ "items/item", "subitem" ] });
    and here in the body section at subitem:
    <tr spry:repeat="dsItems1">
    <td>{@id}</td>
                <td>{menuheading}</td>
                <td>{items/item}</td>
                <td>{subitem}</td>
            </tr>
    ==================================================
    The end result I would like rendered in the menu is:
    ==================================================
    Menuheading
    ---- Item (hyperlink)
    ---- Item (hyperlink)
    ---- Item (hyperlink)
    ---- Item
           ------- sub submenu item (hyperlink)
    Menuheading
    ---- Item
           ------- sub submenu item (hyperlink)
           ------- sub submenu item (hyperlink)
           ------- sub submenu item (hyperlink)
    ---- Item (hyperlink)
    ---- Item (hyperlink)
    ---- Item (hyperlink)
    ...and so on.
    I have attached both files in their entirety at the bottom of the post in hopes someone can help.
    ==================================================
    Here is the relevant HTML
    ==================================================
    <head>
    <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 dsItems1 = new Spry.Data.XMLDataSet("MenuXML.xml", "/menu/menuitem", { subPaths: [ "items/item", "subitem" ] });</script>
    </head>
    <body>
    <div spry:region="dsItems1">
    <table class="dataTable">
    <tr>
    <th width="62">Menu ID</th>
                <th width="171">Menu Heading</th>
                <th width="257">Menu Items</th>
                <th width="257">Submenu Items</th>
            </tr>
    <tr spry:repeat="dsItems1">
    <td>{@id}</td>
                <td>{menuheading}</td>
                <td>{items/item}</td>
                <td>{subitem}</td>
            </tr>
    </table>
    </div>
    </body>
    ==================================================
    A representative snippet of the XML is shown here:
    ==================================================
    <?xml version="1.0" encoding="UTF-8"?>
    <menu>
         <menuitem id="0001" type="Aboutus">
              <menuheading>About Us</menuheading>
                   <items>
                        <item id="0011">Welcome to MHBS</item>
                        <item id="0021">History</item>
                        <item id="0031">Mission</item>
                        <item id="0041">Accreditation</item>
                        <item id="0051">Directions</item>
                        <item id="0061">Calendar</item>
                        <item id="0071">Board of Directors</item>
                                     <subitem id="0111">Meet the Board</subitem>
                        <item id="0081">FAQs</item>
                   </items>
         </menuitem>
         <menuitem id="0002" type="Academics">
              <menuheading>Academics</menuheading>
                   <items>
                        <item id="0012">Meet the Faculty</item>
                        <item id="0022">Elementary</item>
                        <item id="0032">Middle School</item>
                        <item id="0042">High School</item>
                        <item id="0052">Academic Achievements</item>
                                     <subitem id="0251">Test Scores</subitem>
                                     <subitem id="0252">College Acceptance</subitem>
                        <item id="0062">Accelerated Reading</item>
                        <item id="0072">Summer Reading</item>
                        <item id="0082">Guidance and Counseling</item>
                   </items>
         </menuitem>
    ... and on and on ...
    </menu>
    Should I be doing something with the Spry.Data.NestedXMLDataSet instead?
    If so, how do I implement that?
    many thanks in advance

    Yes, you should be using the nested dataset instead.
    Did you read: http://labs.adobe.com/technologies/spry/samples/data_region/NestedXMLDataSample.html ?

  • Nested XML inserted as NULL in table

    I am inserting a nested XML document into two relational tables. I am using Chapter 12 of Steve Muench's book as a guide to build the two tables, the table and object types, the view and the trigger. The master table inserts fine. The row count on the detail table is correct with the PK from the master being inserted, but the values for all of the nested data in the detail table are NULL.
    This same exact thing happens when I use a nested table on the master table instead...nested values are NULL in that collection as well.
    I tried posting all of the code earlier, but the forum post puked. I can again if needed.
    I have seen a couple of old posts on this problem, with no answers...
    TIA,
    Dave

    Thanks for the reply.
    When I am using (Coulmn) == "" ? NULL(DT_WSTR,225) : Coulmn for making blank as null it is working fine.
    But it is making null as string, but I don't want to use null as string. As I am using Null in my stored procedure to load sub region data where "country is null".
    If I will use above expression of derived column it will make it as string which is not recommended in my case.
    Do you have any solution for it.

  • Why it's so inefficient to generate XML from SQL queries?

    I am learning to use Oracle9i XML DB to generate XML document using SQL queries. According to the document, there are multiple ways to do it (SQLX, DBMS_XMLGEN, SYS_XMLGEN, XSU). I am using SQLX to do it, but find it's so inefficient. Could someone point out what could be the problem?
    I generate XML from TPC-H database, using the query as shown below. The indexes and primary key/foreign keys are created and specified. The system is Pentium IV 2GHz, Linux 2.4.18 with 512MB memory and 1GB swap. With database size 5MB, it spends about 300 seconds (TKPROF result) to generate the XML document. But for 10MB TPCH database, I cannot get the xml document after a long time. I find that all almost physical memory are used up by it. Therefore I stop it.
    It seems that nested-loop join is used to evaluate the query, therefore it's very inefficient. I don't know whether there is a efficient way to do it.
    Wish to get your help. Thank you very much!
    Chengkai Li
    ===================================================================================================================
    SELECT XMLELEMENT (
    "region",
    XMLATTRIBUTES ( r_regionkey AS "regionkey", r_name AS "name", r_comment AS "comment"),
    (SELECT XMLAGG(
    XMLELEMENT (
    "nation",
    XMLATTRIBUTES ( n_nationkey AS "nationkey", n_name AS "name", n_regionkey AS "regionkey", n_comment AS "comment"),
    XMLConcat ((SELECT XMLAGG(XMLELEMENT (
    "supplier",
    XMLATTRIBUTES ( s_suppkey AS "suppkey", s_name AS "name", s_address AS "address", s_nationkey AS "nationkey", s_phone AS "phone", s_acctbal AS "acctbal", s_comment AS "comment"),
    (SELECT XMLAGG(XMLELEMENT (
    "part",
    XMLATTRIBUTES ( p_partkey AS "partkey", p_name AS "name", p_mfgr AS "mfgr", p_brand AS "brand", p_type AS "type", p_size AS "size", p_container AS "container", p_retailprice AS "retailprice", p_comment AS "comment", ps_availqty AS "ps_availqty", ps_supplycost AS "ps_supplycost", ps_comment AS "ps_comment")))
    FROM PART p, PARTSUPP ps
    WHERE ps.ps_partkey = p.p_partkey
    AND ps.ps_suppkey = s.s_suppkey
         FROM SUPPLIER s
    WHERE s.s_nationkey = n.n_nationkey
    (SELECT XMLAGG(XMLELEMENT(
    "customer",
    XMLATTRIBUTES ( c_custkey AS "custkey", c_name AS "name", c_address AS "address", c_nationkey AS "nationkey", c_phone AS "phone", c_acctbal AS "acctbal", c_mktsegment AS "mktsegment", c_comment AS "comment"),
    (SELECT XMLAGG(XMLELEMENT (
    "orders",
    XMLATTRIBUTES ( o_orderkey AS "orderkey", o_custkey AS "custkey", o_orderstatus AS "orderstatus", o_totalprice AS "totalprice", o_orderdate AS "orderdate", o_orderpriority AS "orderpriority", o_clerk AS "clerk", o_shippriority AS "shippriority", o_comment AS "ps_comment"),
    (SELECT XMLAGG(XMLELEMENT (
    "lineitem",
    XMLATTRIBUTES ( l_orderkey AS "orderkey", l_partkey AS "partkey", l_suppkey AS "suppkey", l_linenumber AS "linenumber", l_quantity AS "quantity", l_extendedprice AS "extendedprice", l_discount AS "discount", l_tax AS "tax", l_returnflag AS "returnflag", l_linestatus AS "linestatus", l_shipdate AS "shipdate", l_commitdate AS "commitdate", l_receiptdate AS "receiptdate", l_shipinstruct AS "shipinstruct", l_shipmode AS "shipmode", l_comment AS "comment")
    FROM LINEITEM l
    WHERE l.l_orderkey = o.o_orderkey
    FROM ORDERS o
    WHERE o.o_custkey = c.c_custkey
         FROM CUSTOMER c
    WHERE c.c_nationkey = n.n_nationkey
    FROM NATION n
    WHERE n.n_regionkey = r.r_regionkey
    FROM REGION r;

    Tim,
    Oracle Reports was the orginal way to do this in an Oracle Apps environment. However, the XML Publisher team built a tool called data templates to do this as well. You can read several articles on how to use data templates on the XMLP blog. Here's the first arcticle in a series: http://blogs.oracle.com/xmlpublisher/2006/11/08#a127.
    Bryan

  • How to generate XML from EBusiness suite ARXSGPO

    Could someone tell me how I can generate XML from the EBusiness Suite Accounts Receivable report ARXSGPO.rdf I understand this report is called by a C program. I have tried changing the concurrent request to output format to XML the result does not resemble XML. Does anyone have any suggestions how I can generate XML from the ARXSGPO report?
    Thanks,
    Mark

    Hi Mark
    the next release of XMLP will have last page only support. The problem is that at the template layer you do not know how many lines are going to fit on the page, so you never know what is going to be the last page. The only way around it for now is to specify the number of lines to a page and then check when all the lines have been rendered and then render the remit portion.
    I have a sample invoice that does the same, drop me a mail, you can work out the email from my name and the fact I work for XMLP Im sure.
    Tim

Maybe you are looking for