CDATA & nested XML data

I've read the various entries and have ensured the column is
defined to have HTML content, but in IE7 & Spry 1.6 the content
provided through the NestedXMLDataSet is not being interpreted as
HTML, whereas the content from the XMLDataSet is interpreted
correctly. I reduced the xml data and the page to its most
simplistic:
e.g.
var dsNursery = new
Spry.Data.XMLDataSet("data/nursery_template.xml", "/events/event");
var dsItems = new Spry.Data.NestedXMLDataSet(dsNursery,
"items");
dsNursery.setColumnType("heading", "html");
dsItems.setColumnType("content", "html");
<body>
<div id="container">
<div id="sidebar1">
<ul id="MenuBar1" class="MenuBarVertical"
spry:region="dsNursery dsItems">
<li spry:repeat="dsNursery" spry:setrow="dsNursery">
<a class="MenuBarItemSubmenu" href="#"
spry:if="{dsItems::ds_RowCount} > 1">{heading}</a>
<a href="#" spry:if="{dsItems::ds_RowCount} ==
1">{heading}</a>
<ul spry:if="{dsItems::ds_RowCount} > 1">
<li spry:repeat="dsItems" spry:setrow="dsItems"><a
href="#">{dsItems::item}</a></li>
</ul>
</li>
</ul>
<!-- end #sidebar1 --></div>
<div id="mainContent">
<div id="MenuBar1Detail" spry:detailregion="dsNursery
dsItems">
<div id="content">{dsItems::content}
{heading}</div> <----------------------- "content" is not
interpreted, but "heading" is.
</div>
<!-- end #mainContent --></div>
<script type="text/javascript">
Spry.Data.Region.addObserver('MenuBar1',{onPostUpdate:function(){var
MenuBar1 = new Spry.Widget.MenuBar("MenuBar1");}});
</script>
</body>
</html>
XML file is:
<?xml version="1.0" encoding="utf-8"?>
<events>
<event>
<heading><![CDATA[<strong>heading
1</strong>]]></heading>
<items>
<item >item 1</item>
<content ><![CDATA[<strong>content
1</strong>]]></content>
</items>
</event>
</events>
Any assistance is gratefully appreciated.

Hi fcc770,
I fixed the setColumnType problem for nested data sets after
we shipped Spry 1.6. You can find a version with the bug fix here:
http://labs.adobe.com/technologies/spry/includes/SpryNestedXMLDataSet.js
The header at the top of the JS file should read version 0.4
or greater.
Let me know if that fixes your problem.
--== Kin ==--

Similar Messages

  • Working With Nested XML Data

    Hello,
    I'm doing my best to create a page in Dreamweaver CS4 utilizing Spry datasets and, I hope, a valid nested XML file. What I want to do is use one XML file that provides the content for my nav div and my content div. It would, in essence, display as an outline. When a user clicks on an item in the nav div the content would be displayed. What I'm guessing would work for the XML file would be this format:
    <content>
      <topic name="Elements">   //--this would serve as the nav element and trigger
        <header>Non-editable</header>   //--this would serve as a header in the content area
        <info>
          <detail id="1">CSS, javascript</detail>   //--this would serve as detail under the headers in the content area.
          <detail id="2">Headers</detail>
          <detail id="3">Footers</detail>
          <detail id="4">Areas within navigation panel</detail>
        </info>
      </topic>
    </content>
    I got the idea from this page in Live Docs: Create a Spry nested data set. Also from a Labs page called Nested XML Data Sample. I've been able to make various parts of the page work but I don't know what is broken. My issues are this:
    I once saw but can no longer find a method for preventing redundant display of data. In this case, the nav elements which are attributes in my XML file.
    The details are showing up in my content area. I must be doing the code for the nesting incorrectly.
    I want to then use the details in the content area to trigger spry tooltips, the content for whih would be genereated from an XML file or HTML frags.
    Here is my latest, ill-fated attempt:
    <!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=UTF-8" />
    <title>Menu - Content Example</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryNestedXMLDataSet.js" type="text/javascript"></script>
    <script src="SpryAssets/xpath.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryStackedContainers.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
    <!--
    var dsContent5 = new Spry.Data.XMLDataSet("navigation/content5.xml", "content/topic", {useCache: false});
    var dsInfo = new Spry.Data.NestedXMLDataSet(dsContent5, "info/detail");
    //-->
    </script>
    </head>
    <body>
    <div id="wrapper">
      <div id="header">
        <h1>CSU Website Clinic</h1>
        <h3>Bill Milhoan, IS&amp;T Technical Trainer</h3>
      </div>
      <div id="content" spry:region="dsInfo">
        <ul spry:repeatchildren="dsInfo">
          <li>{dsContent5::info}</li>
        </ul>
      </div>
      <div class="nav" spry:region="dsContent5">
        <ul spry:repeatchildren="dsContent5" spry:choose="">
          <li spry:when="{dsContent5::ds_CurrentRowID} == {dsContent5::ds_RowID}" spry:setrow="dsContent5" spry:select="select" spry:hover="hover" spry:selected="">{dsContent5::@name}</li>
          <li spry:default="" spry:setrow="dsContent5" spry:select="select" spry:hover="hover">{dsContent5::@name}</li>
        </ul>
      </div>
    </div>
    </body>
    </html>
    Thoughts? My hope is to distill this process so I can teach others how to do it in the hopes that they will find it easier to keep their department/program websites up-to-date.
    Thanks for the help.
    Bill Milhoan
    Cleveland State University

    I apologize, im using Spry XML Data Set. i guess the best way to describe what im trying to do is, i want to use the Non-desctructive filter sample with the Spry Nested XML Data sample. So with my sample xml on my first post and with the same code non-destructive filter is using, im having trouble trying to search repeating nodes, for some reason it only searches the last node of the repeating nodes. Does that make sense? let me know.
    thank you Arnout!

  • Correction for Nested XML Data Sample

    I found an error in the sample code on the
    Nested
    XML Data Sample under "Using Nested Data Sets." Line 8 has
    var dsToppings = new Spry.Data.NestedXMLDataSet(dsItems1,
    "toppings");, but it should be
    var dsToppings = new Spry.Data.NestedXMLDataSet(dsItems1,
    "topping"); in order to match the XML file.
    Another suggestion for us newbies would be to have the
    samples start with a comment about any additional scripts we need
    to insert into our files. It took me a long time to realize I
    needed to include
    <script type="text/javascript"
    src="scripts/SpryNestedXMLDataSet.js"></script> with
    the others in the head.
    Thanks for your work!
    Jonathan

    Hi Jonathan,
    Thanks for catching that. I corrected the doc and the change
    will appear when we release 1.5.
    Also, regarding <script> includes sample, yes, we
    should definitely be doing that.
    Thanks!!!
    --== Kin ==--

  • 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 Non-destructive filter with Nested XML data

    Hi,
    How do you use Non-destructive filter with Nested XML data?
    I am using the non-destructive filter sample with my own xml which is setup to search for the <smc></smcs> in my xml below. But when i test it it only searches the last row of the "smc". How can i make it work so it can search for repeating nodes? or does it have something to with how my xml is setup?
        <ja>
            <url>www.sample.com</url>
            <jrole>Jobrole goes here</jrole>
            <prole>Process role goes here...</prole>
            <role>description...</role>
            <prole>Process role goes here...</prole>
            <role>description....</role>
            <prole>Process role goes here...</prole>
            <role>description...</role>
            <sjc>6K8C</sjc>
            <sjc>6B1B</sjc>
            <sjc>6B1F</sjc>
            <sjc>6B1D</sjc>
            <smc>6C9</smc>
            <smc>675</smc>
            <smc>62R</smc>
            <smc>62P</smc>
            <smc>602</smc>
            <smc>622</smc>
            <smc>642</smc>
            <smc>65F</smc>
            <smc>65J</smc>
            <smc>65L</smc>
            <smc>623</smc>
            <smc>625</smc>
            <smc>624</smc>
            <smc>622</smc>
            <audience>Target audience goes here....</audience>
        </ja>
    here is the javascript that runs it.
    function FilterData()
        var tf = document.getElementById("filterTF");
        if (!tf.value)
            // If the text field is empty, remove any filter
            // that is set on the data set.
            ds1.filter(null);
            return;
        // Set a filter on the data set that matches any row
        // that begins with the string in the text field.
        var regExpStr = tf.value;
    if (!document.getElementById("containsCB").checked)
            regExpStr = "^" + regExpStr;
        var regExp = new RegExp(regExpStr, "i");
        var filterFunc = function(ds, row, rowNumber)
            var str = row["smc"];
            if (str && str.search(regExp) != -1)
            return row;
            return null;
        ds1.filter(filterFunc);
    function StartFilterTimer()
        if (StartFilterTimer.timerID)
            clearTimeout(StartFilterTimer.timerID);
        StartFilterTimer.timerID = setTimeout(function() { StartFilterTimer.timerID = null; FilterData(); }, 100);
    I really need help on this, or are there any other suggestions or samples that might work?
    thank you!

    I apologize, im using Spry XML Data Set. i guess the best way to describe what im trying to do is, i want to use the Non-desctructive filter sample with the Spry Nested XML Data sample. So with my sample xml on my first post and with the same code non-destructive filter is using, im having trouble trying to search repeating nodes, for some reason it only searches the last node of the repeating nodes. Does that make sense? let me know.
    thank you Arnout!

  • 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 ?

  • Transfer of nested XML data to BW

    Hi there Experts
    I am trying to transfer XML data to BW.  I have done the worked example in the “How to … send XML Data to BW” document and it’s all working fine. 
    The problem with the example is that the data is in a “flat” format without any nested loops.  So for one Vendor 4711 and two materials “gizmo” and “widgets” the data structure essentially looks like this:
    <DATA>
         <item>
              <VENDOR>4711</VENDOR>
              <MATERIAL>gizmo</MATERIAL>
         </item>
         <item>
              <VENDOR>4711</VENDOR>
              <MATERIAL>widget</MATERIAL>
         </item>
    <DATA>
    Now, since we have a fair bit of data, rather than creating one new line (item) for each combination of VENDOR and MATERIAL we want to set up a nested structure in XML that can be read in BW, something along the lines of
    <DATA>
         <item>
              <VENDOR>4711</VENDOR>
                   <MATERIAL>gizmo</MATERIAL>
                   <MATERIAL>widget</MATERIAL>
         </item>
    <DATA>
    Unfortunately, all attempts have failed so far to create such a structure and admittedly I know very little about XML to begin with.  Any ideas?
    Thanks and greetings from Hamburg!
    Christian

    Hi ,
    You mentioned that you have sucessfully configured to load the XML data into BW.
    Even I also tried to configure by refering to the "How to" document, but am not sucessfull. Could you please help me in this regard.
    I configured the .dll files, but still am getting the
    error "Automation server can't create the object".
    Could you send me the step by step procedure..
    The operating system we are using is the Windows XP.
    Even i searched the SDN, couple of them replied, its not sucessfull.
    Thanks in Advance,
    Prathima Suram

  • Problem creating nested xml data using XSQLServlet

    Hi,
    This is sort of a sql question.
    I'm trying to create a nexted xml data file.
    The data in a rows format can be had using the
    following query...
    SELECT username, portlet_name, count(instance_name) as
    INSTANCE_COUNT
    FROM portlet_user_subscriptions
    GROUP BY username, portlet_name
    to get is back in a hierrachical format, I tried the
    following...
    SELECT distinct(username) as USERNAME,
    CURSOR (
         SELECT portlet_name, count(instance_name) as
    NUM_INSTANCES
         FROM portlet_user_subscriptions T2
         WHERE T2.username=USERNAME
         GROUP BY portlet_name ) AS PORTLETS
    FROM portlet_user_subscriptions T1
    But, that is running the CURSOE for every username in the
    other loop when it should be doing it only for distinct
    usernames.
    What am I doing wrong here...
    cheers,
    Vijay

    How you store the data in the database?
    Basically, you can query the database with XSQL(<xsql:query/>)
    to get the output in XML. Then you can use XSLT to transform it
    to the format you want.
    <?xml-stylesheet type="text/xsl" href="doyouxml.xsl" ?>
    ...

  • Selecting the XML data from a drop-down menu or links

    Hi, I have this page:
    http://www.georgeglazer.com/prints/nathist/botanical/volckinv/volckinv.html
    There are prints of lemons/limes and prints of oranges. I
    want to have the visitor select which kind of fruit from either a
    drop-menu or from two links that look something like this:
    Lemons/Limes | Oranges. Looking at other help docs I found the
    region/state mapping demo at
    http://labs.adobe.com/technologies/spry/samples/data_region/StateMappingSample.html,
    and copied the code and tried to modify it. But I don't really
    understand the technical shorthand of the help docs (an ongoing
    problem I have with the Spry documentation) and I couldn't find the
    XML docs that the region/state mapping demos are based on so I
    couldn't see how they were set up.
    I got as far as this: nothing loads initially when you open
    the page (I'd like the lemons to load), but if you select Oranges
    from the drop-down menu you see the oranges, and THEN once you've
    done that, you can select Lemons/Limes in the drop-down menu and
    see those. I have three XML files I've been playing around with to
    get this to work: lemons.xml, oranges.xml and inventory.xml, which
    combines the two.
    I also suspect region/state mapping might not even be exactly
    what I'm trying to do here, but I can't figure out from the
    documentation exactly what this thing I'm trying to do is called. I
    know the photo album demo accomplishes something similar, and I
    could do that, but it seems way more complicated than what I need
    here (right?). Help will be appreciated!
    Thanks,
    Helen

    I made a different test using the file
    http://www.georgeglazer.com/prints/nathist/botanical/volckinv/inventory.xml
    and
    http://www.georgeglazer.com/prints/nathist/botanical/volckinv/volcktest.html
    where I sent up the inventory xml form like one I found in the
    Nested XML Data documentation where you have item ids and types, so
    all the oranges and lemons are in one XML document (which I'd
    prefer).
    Here's an abbreviated version of the inventory.xml:
    <inv_items>
    <inv_item id="1" type="lemon">
    <name>Lemons and Limes</name>
    <title>Cedro Ordinario</title>
    <plate>116a</plate>
    <fullimage>pl116a.jpg</fullimage>
    <tn>pl116a-2.jpg</tn>
    </inv_item>
    [and more lemons follow]
    <inv_item id="19" type="orange">
    <name>Oranges and Others</name>
    <title>La Zucchetta Imperiale</title>
    <plate>138a</plate>
    <fullimage>pl138a.jpg</fullimage>
    <tn>pl138a-2.jpg</tn>
    </inv_item>
    [and more oranges follow]
    </inv_items>
    What I'd like to do is display the names "Lemons and Limes"
    and "Oranges and Others" and when you click on "Lemons and Limes"
    you see only the thumbnails for lemons and limes, and when you
    click on "Oranges and Others" you see the thumbnails for only
    those. I'd like the Lemons and Limes to be selected when the page
    is opened.
    Help greatly appreciated!

  • Little help with complex XML data as data provider for chart and adg

    Hi all,
    I've been trying to think through a problem and Im hoping for
    a little help. Here's the scenario:
    I have complex nested XML data that is wrapped by subsequent
    groupings for efficiency, but I need to determine if each inner
    item belongs in the data collection for view in a data grid and
    charts.
    I've posted an example at the bottom.
    So the goal here is to first be able to select a single
    inspector and then chart out their reports. I can get the data to
    filter from the XMLListCollection using a filter on the first layer
    (ie the name of the inspector) but then can't get a filter to go
    deeper into the structure in order to determine if the individual
    item should be contained inside the collection. In other words, I
    want to filter by inspector, then time and then tag name in order
    to be able to use this data as the basis for individual series
    inside my advanced data grid and column chart.
    I've made it work with creating a new collection and then
    looping through each time there is a change to the original
    collection and updating the new collection, but that just feels so
    bloated and inefficient. The user is going to have some buttons to
    allow them to change their view. I'm wondering if there is a
    cleaner way to approach this? I even tried chaining filter
    functions together, but that didn't work cause the collection is
    reset whenever the .refresh() is called.
    If anyone has experience in efficiently dealing with complex
    XML for charting purposes and tabular display purposes, I would
    greatly appreciate your assistance. I know I can get this to work
    with a bunch of overhead, but I'm seeking something elegant.
    Thank you.

    Hi,
    Please use the code similar to below:
    SELECT * FROM DO_NOT_LOAD INTO TABLE IT_DO_NOT_LOAD.
    SORT IT_DO_NOT_LOAD by WBS_Key.
        IF SOURCE_PACKAGE IS NOT INITIAL.
          IT_SOURCE_PACKAGE[] = SOURCE_PACKAGE[].
    LOOP AT IT_SOURCE_PACKAGE INTO WA_SOURCE_PACKAGE.
            V_SYTABIX = SY-TABIX.
            READ TABLE IT_DO_NOT_LOAD into WA_DO_NOT_LOAD
            WITH KEY WBS_Key = WA_SOURCE_PACKAGE-WBS_Key
            BINARY SEARCH.
            IF SY-SUBRC = 0.
              IF ( WA_DO_NOT_LOAD-WBS_EXT = 'A' or WA_DO_NOT_LOAD-WBS_EXT = 'B' )     
              DELETE IT_SOURCE_PACKAGE INDEX V_SYTABIX.
            ENDIF.
    ENDIF.
          ENDLOOP.
          SOURCE_PACKAGE[] = IT_SOURCE_PACKAGE[].
        ENDIF.
    -Vikram

  • Populating Spry Table using button action and Nested XML

    Ah, yet another question.
    So I have a catalog page with a Spry repeating table. The XML
    has 2 sets of nodes -- one for outfits and one for line sheets (the
    technical drawings for clothes). What i want to do is have the
    outfits show and populate the table to start off with, but
    re-populate with the line sheet info if a user clicks on a button.
    currently the page is set up and works perfectly by sucking
    in the XML and populating the table. What I can't seem to do is get
    the button (when clicked) to switch the outfit info with the line
    sheet info.
    I have the following
    // javascript:
    var siracusafall08 = new
    Spry.Data.XMLDataSet("fall_collection.xml",
    "collection/siracusa/outfits", { filterFunc: MyPagingFunc });
    var siracusaLS = new
    Spry.Data.NestedXMLDataSet(siracusafall08, "linesheet",
    {filterFunc:MyPagingFunc });
    siracusafall08.setColumnType("photoURL", "image");
    siracusafall08.setColumnType("lrgphoto", "image");
    var pageOffset = 0;
    var pageSize = 1;
    var pageStop = pageOffset + pageSize;
    //var dssiracusafall08 = new
    Spry.Data.XMLDataSet("fall_collection.xml", "collection/outfits", {
    filterFunc: MyPagingFunc });
    function MyPagingFunc(ds, row, rowNumber)
    if (rowNumber < pageOffset || rowNumber >= pageStop)
    return null;
    return row;
    function chooseLS()
    // no idea what to put here...
    function UpdatePage(offset)
    var numRows = siracusafall08.getUnfilteredData().length;
    if (offset > (numRows - pageSize))
    offset = numRows - pageSize;
    if (offset < 0)
    offset = 0;
    pageOffset = offset;
    pageStop = offset + pageSize;
    // Re-apply our non-destructive filter on dsStates1:
    siracusafall08.filter(MyPagingFunc);
    html
    <div spry:region="siracusafall08">
    <table>
    <tr spry:repeatchildren="siracusafall08">
    <td valign="top">{name}<br />{desc}</td>
    <td rowspan="8" valign="top" width="300"><img
    src="imx/{photoURL}"/></td>
    </tr>
    <tr spry:repeatchildren="siracusafall08">
    <td valign="top">{SKU1}<br />{SKU2}<br
    />{SKU3}</td>
    </tr>
    <tr spry:repeatchildren="siracusafall08">
    <td valign="top"><a href="imx/{lrgphoto}"
    target="_blank">enlarge</a></td>
    </tr>
    <tr spry:repeatchildren="siracusafall08">
    <td valign="top"><input type="image"
    src="../../imx/back.gif" onclick="UpdatePage(pageOffset -
    pageSize);" />
    <input type="image" src="../../imx/next.gif"
    onclick="UpdatePage(pageOffset + pageSize);" /><br
    /><br /><input type="button" value="filter"
    onclick="chooseLS();" /></td>
    </tr>
    <tr>
    <td height="200"> </td>
    </tr>
    </table>
    </div>
    XML
    <collection>
    <siracusa>
    <outfits>
    <photoURL>6648sm.jpg</photoURL>
    <lrgphoto>6648lg.jpg</lrgphoto>
    <SKU1>JS271SM</SKU1>
    <SKU2>PN109SM</SKU2>
    <SKU3></SKU3>
    <name>Siracusa Micro Crepe</name>
    <desc>Chestnut, Moss, Redwood, Black</desc>
    </outfits>
    <outfits>
    <photoURL>5237sm.jpg</photoURL>
    <lrgphoto>5237lg.jpg</lrgphoto>
    <SKU1>JS272SM</SKU1>
    <SKU2>LTK121SM</SKU2>
    <SKU3>PW112SM</SKU3>
    <name>Siracusa Micro Crepe</name>
    <desc>Chestnut, Moss, Redwood, Black</desc>
    </outfits>
    <outfits>
    <photoURL>5540sm.jpg</photoURL>
    <lrgphoto>5540lg.jpg</lrgphoto>
    <SKU1>JS272SM</SKU1>
    <SKU2>LTK121SM</SKU2>
    <SKU3>PW112SM</SKU3>
    <name>Siracusa Micro Crepe</name>
    <desc>Chestnut, Moss, Redwood, Black</desc>
    </outfits>
    <outfits>
    <photoURL>6276sm.jpg</photoURL>
    <lrgphoto>6276lg.jpg</lrgphoto>
    <SKU1>JL258SM</SKU1>
    <SKU2>PN100SM</SKU2>
    <SKU3></SKU3>
    <name>Siracusa Micro Crepe</name>
    <desc>Chestnut, Moss, Redwood, Black</desc>
    </outfits>
    <linesheet>
    <photoURL>5540sm.jpg</photoURL>
    <lrgphoto>5540lg.jpg</lrgphoto>
    <SKU1>JS128SM</SKU1>
    <SKU2>Mandarin collar jacket with box pleat
    cuff</SKU2>
    <SKU3>XS-XL</SKU3>
    <name>Siracusa Micro Crepe</name>
    <desc>Chestnut, Moss, Redwood, Black</desc>
    </linesheet>
    </siracusa>
    </collection>
    There's nothing in the documentation about using a button to
    repopulate a table. the Nested XML Data Sample page in the Spry
    documentation has been helpful in the past however this is more of
    a switch / toggle situation and frankly that kind of coding is a
    bit beyond my fine arts-trained skills.
    Any suggestions are greatly appreciated!

    Hi Bit Crusher,
    Sorry for the delayed response ...
    Looking at your setup, you can get rid of most of the code in
    collection.js since you are using a pageSize of 1 ... if displaying
    only one row of a data set is all you ever need, then you can get
    the equivalent functionality by just using a spry:detailregion and
    a couple of prev()/next() functions. For example:
    <script type="text/javascript">
    var siracusafall08 = new
    Spry.Data.XMLDataSet("fall_collection.xml",
    "collection/siracusa/outfits");
    siracusafall08.setColumnType("photoURL", "image");
    siracusafall08.setColumnType("lrgphoto", "image");
    var crepesfall08 = new
    Spry.Data.XMLDataSet("fall_collection.xml",
    "collection/crepes/outfits");
    crepesfall08.setColumnType("photoURL", "image");
    crepesfall08.setColumnType("lrgphoto", "image");
    function DSPrev(ds)
    var curRowNum = ds.getCurrentRowNumber();
    if (--curRowNum >= 0)
    ds.setCurrentRowNumber(curRowNum);
    function DSNext(ds)
    var curRowNum = ds.getCurrentRowNumber();
    if (++curRowNum < ds.getRowCount())
    ds.setCurrentRowNumber(curRowNum);
    </script>
    <div spry:detailregion="siracusafall08">
    </div>
    <div spry:detailregion="crepesfall08">
    </div>
    After you've simplified all that, the next thing I would do
    to get your linesheet switching working is to use "states". Take a
    look at these samples:
    http://labs.adobe.com/technologies/spry/samples/data_region/RegionStatesSample.html
    http://labs.adobe.com/technologies/spry/samples/data_region/StateMappingSample.html
    The first link is some basic background on states, but what
    should be of interest to you is the 2nd sample. What I would do is
    have a "styles" and a "linesheet" state in my region.
    Also since you are using nested XML data, you will need to
    access your <linesheet> data with a NestedXMLDataSet:
    http://labs.adobe.com/technologies/spry/samples/data_region/NestedXMLDataSample.html#Using NestedDataSets
    http://labs.adobe.com/technologies/spry/samples/data_region/NestedDataSample.html
    --== Kin ==--

  • 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 insert a new line character inside CDATA tag in the source xml data file?

    values for form fields in the xml data file is contained inside CDATA tags which is an Unparsed Format.
    Eg: [CDATA[IBM-01 ~ DSHFSJDSJ ~ FGFGFJ, ~ VA 665665]] delimited by "~" char
    Actual o/p:-
    IBM-01 ~ DSHFSJDSJ ~ FGFGFJ, ~ VA 665665
    Expected o/p is like :-
    IBM-01
    DSHFSJDSJ
    FGFGFJ,
    VA 665665
    live cycle product does not interpret ~ as a newline character. Please suggest which character should be used instead inside CDATA section or if there is any other way to fix this?

    I do not have any problem while using IE's XML parser
    for XML+XSLT merging.That is because IE's parser does not implement XML correctly.
    But when I use JAXP's Transformer object, it does not
    preserve the new lines inside attribute values and
    converts those into white spaces.That is exactly what the XML specifications say should happen.
    >
    ----If you have text that contains newlines, you
    should put it in an element, not in
    ----an attribute.
    That would be my last solution. But I'd really hate
    to change my logic just 'coz JAXP is not capable of
    handling new lines inside attribute values. I may be
    wrong... but If IE can keep those then there has to
    be a way to do the same from server side merging....Sure. Write your own parser with the same bug in it. But you don't have any right to demand that other people supply you with parsers that work incorrectly.

  • Xml-fragment Issue retrieving Nested element data

    Hi,
    I've problem retrieving the nested element data from the xml. Using XmlBeans I am getting null when retriving the inner element. I printed the nested element xmlobject it has Xml-Fragment wrapped. I tired using below code it doesn't throw any error but the data is lost
    AAAA TempObj=AAAA.getBXXX().getCXXX(0);
    //remove xml fragment
    XmlOptions xmlOpt = new XmlOptions();
    xmlOpt.setSaveOuter();
    XmlCursor c= TempObj.newCursor();
    c.toFirstChild();
    Myclass myclassObj= Myclass.Factory.parse(c.getObject().xmlText(xmlOpt));
    log.debug("Records: "+myclassObj .getXXArray().length);
    Output:
    length should give aleast 1 or more but I am getting 0. That means the xmltext didn't parse properly.
    Can anybody suggest what could be the problem.
    Thanks in advance.
    -Sri

    no answer

  • Database data to nested xml structure

    Hi All,
    I need to convert the data in the oracle database to nested xml tree structure as below:
    Data in the database is in the following structure:
    1     branch1     13-JAN-11     a.txt
    1     branch1     25-JAN-11     b.txt
    1     branch1     25-JAN-11     c.txt
    1     branch2     20-JAN-11     d.txt
    2
    XML for the above data should be in the format:
    <Root>
    <Account_no value="1">
    <Desc value="branch1">
    <Date value="13-JAN-11">
    <Name value="a.txt"/>
    </Date>
    <Date value="25-JAN-11">
    <Name value="b.txt"/>
    <Name value="c.txt"/>
    </Date>
    </Desc>
    <Desc value="branch2">
    <Date value="20-JAN-11">
    <Name value="d.txt"/>
    </Date>
    </Desc>
    </Account_no>
    <Account_no value="2">
    </Account_no>
    </Root>
    I am able to get this kind of xml structure using java after storing the database data in a n-ary tree. But it takes more time to execute.
    Can this kind of same xml format be achieved using pl/sql programming?
    Please help me with your valuable insights.
    Thanks,
    Alagappan

    Hi,
    Please always mention your db version (select * from v$version).
    Here's one solution using SQL/XML functions :
    Sample data used :
    create table sample_data
      account_no  number,
      description varchar2(30),
      dt          date,
      name        varchar2(30)
    insert into sample_data values(1, 'branch1', to_date('13-JAN-11','DD-MON-RR'), 'a.txt');
    insert into sample_data values(1, 'branch1', to_date('25-JAN-11','DD-MON-RR'), 'b.txt');
    insert into sample_data values(1, 'branch1', to_date('25-JAN-11','DD-MON-RR'), 'c.txt');
    insert into sample_data values(1, 'branch2', to_date('20-JAN-11','DD-MON-RR'), 'd.txt');
    insert into sample_data values(2, 'branch3', to_date('20-JAN-11','DD-MON-RR'), 'e.txt');Query :
    SELECT xmlserialize(document
             xmlelement("Root",
               xmlagg(
                 xmlelement("Account_no", xmlattributes(account_no as "value"),
                   xmlagg(
                     xmlelement("Desc", xmlattributes(description as "value"), dt)
                     order by description
                 ) order by account_no
           as clob indent ) doc
    FROM (
      SELECT account_no, description,
             xmlagg(
               xmlelement("Date", xmlattributes(to_char(dt,'DD-MON-RR') as "value"), name)
               order by dt
             ) dt
      FROM (
        SELECT account_no, description, dt,
               xmlagg(
                 xmlelement("Name", xmlattributes(name as "value"))
                 order by name
               ) name
        FROM sample_data
        GROUP BY account_no, description, dt
      GROUP BY account_no, description
    GROUP BY account_no
    DOC
    <Root>
      <Account_no value="1">
        <Desc value="branch1">
          <Date value="13-JAN-11">
            <Name value="a.txt"/>
          </Date>
          <Date value="25-JAN-11">
            <Name value="b.txt"/>
            <Name value="c.txt"/>
          </Date>
        </Desc>
        <Desc value="branch2">
          <Date value="20-JAN-11">
            <Name value="d.txt"/>
          </Date>
        </Desc>
      </Account_no>
      <Account_no value="2">
        <Desc value="branch3">
          <Date value="20-JAN-11">
            <Name value="e.txt"/>
          </Date>
        </Desc>
      </Account_no>
    </Root>
    Here, I used XMLSerialize function with indent option to format the output (available starting with 11g).

Maybe you are looking for