XML data for Spry Menu ?

I maintain several web sites with static pages that all carry
a common Spry menu bar hard coded into each page via a template.
How can I use an XML file to feed a Spry menu widget to save
uploading all the pages every time there is a change on the site
that requires the menu to be updated?
I've searched the web and help files for an answer to this
without success, so any help or pointers would be most appreciated.

I made this example that uses a xml file to build the spry
menu, the page is html, you need to make a seperate dataset for
each <ul> tag, or item group in the menu, notice the two
datasets in my sample, you could expand and make as many as you
want, all drawn from xml files. check out the page here:
http://gohbcc.com/examples/menutest.html
html page:
<!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>Untitled Document</title>
<script src="SpryAssets/SpryMenuBar.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/SpryMenuBarHorizontal.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
var ds1 = new Spry.Data.XMLDataSet("s.xml", "links/link");
var ds2 = new Spry.Data.XMLDataSet("t.xml", "links/link");
//-->
</script>
</head>
<body>
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a class="MenuBarItemSubmenu" href="#">Item
1</a>
<ul>
<div spry:region="ds1">
<li spry:repeat="ds1">
<a href="{a/@href}">{a}</a>
</li>
</div>
<li><a href="#">Item 1.1</a></li>
<li><a href="#">Item 1.2</a></li>
<li><a href="#">Item 1.3</a></li>
</ul>
</li>
<li><a href="#">Item 2</a></li>
<li><a class="MenuBarItemSubmenu" href="#">Item
3</a>
<ul>
<div spry:region="ds2">
<li spry:repeat="ds2">
<a href="{a/@href}">{a}</a>
</li>
</div>
<li><a href="#">Item 3.2</a></li>
<li><a href="#">Item 3.3</a></li>
</ul>
</li>
<li><a href="#">Item 4</a></li>
</ul>
<p> </p>
<div spry:region="ds1" style="float:right;">
<table>
<tr>
<th>A</th>
<th>A/@href</th>
</tr>
<tr spry:repeat="ds1">
<td>{a}</td>
<td>{a/@href}</td>
</tr>
</table>
</div>
<p> </p>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1",
{imgDown:"SpryAssets/SpryMenuBarDownHover.gif",
imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
</html>
XML Files
t.xml;
<?xml version="1.0" encoding="utf-8"?>
<links>
<link><a
href='customer_enter.php?method=Fname'>First
Name</a></link>
<link><a
href='customer_enter.php?method=caseNum'>Case
Number</a></link>
<link><a
href='customer_enter.php?method=Lname'>Last
Name</a></link>
<link><a
href='customer_enter.php?method=caseWorker'>Case
Worker</a></link>
</links>
s.xml:
<?xml version="1.0" encoding="utf-8"?>
<links>
<link><a href='customer_find.php?method=name'>By
Name</a></link>
<link><a
href='customer_find.php?method=caseNum'>By Case
Number</a></link>
<link><a href='customer_find.php?method=date'>By
Date</a></link>
<link><a
href='customer_find.php?method=itemNum'>By Item
Number</a></link>
</links>

Similar Messages

  • Using external xml for spry menu help

    Just started playing with DW CS3, I would like to know how to
    insert a spry menu and get the xml data from an external file. Can
    anyone point me at a suitable example or tutorial please?

    The video workshop has some great tutorials with spry.
    http://www.adobe.com/designcenter/video_workshop/
    Aram

  • Problem with .css for Spry menu

    Hi,
    I am having a problem with the Spry menu I have created and edited. All looks great in the Design view of Photoshop however under the Live view or opened using a browser the menu reverts to a list of hyperlinks!
    I have checked the .css link but when using Firefox CSS editor the CSS file for the menu is simply blank?
    Any suggestions would be great!
    Thanks,
    Ozan

    Your SpryMenuBarHorizontal.css needs to be within your SpryAssets folder, which is where it would have been put automatically when you inserted the SpryMenuBar. You can move it back in there using the Files Panel.
    Here is what the file structure needs to look like:
    SpryAssets
    SpryMenuBar.js
    SpryMenuBarHorizontal.css
    cssstyletemplate.css
    index.html (or whatever the name of your page is)
    Hierarchally, the top level of your root folder will show folders for SpryAssets and css and the html pages will be on the same level.
    The Spry assets themselves will be down a level IN the SpryAssets folder, as the styletemplate.css file will be down a level IN the css folder.
    In the head of the document, you will have
         <link rel="stylesheet" type="text/css" href="css/styletemplate.css" />
         <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"> </script>
         <link rel="stylesheet" type="text/css" href="SpryAssets/SpryMenuBarHorizontal.css" />
    At the end, remove the slash before Spry inside the imgDown and imgRight sections:
         <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    Compare these with your files and file structure and correct any small typos, and they should be correctly linked.
    Beth

  • Filter XML Data for ListBox

     This is the continuation of "Filter ListBox w/ XML Data using a TextBox"
    Andy, I read your paper last night. You are so high that I can only understand some of it right now, but you do bring up a performance issue, which needs to be considered for this thread.
    Is myListBox.Items a view or the items that have already loaded into the myListBox? I am confused. If myListBox.Items are the items that are currently in the myListBox, then there will be an performance issue if there are a huge amount of items in the myListBox.
    Am I right?
    Then, the process supposed to be:
    1, add XML source to Blend
    2, filter the source
    3, put in the listbox
    Then the code will be much complicated than the 1st one. right?
    private void filterBtn_Click(object sender, RoutedEventArgs e)
          myListBox.Items.Filter = target => ((XmlElement)target)["ID"].InnerText.Contains(myTextBox.Text);

    There's a pattern that almost every wpf dveloper uses and it's called mvvm.
    Google it, there'll be a shed load of articles.
    It's a passive view pattern in that the view has minimal logic in it.
    The view is your window ( or usercontrol).
    You can add a listboxitem to the listbox.items collection but i would only do  that if it's a very simple static collection.
    You can bind a collection to itemssource and the listbox will create a listboxitem for each things it gets from that collection.
    It creates them using a datatemplate.
    When you do that binding apparently directly to a collection a collectionvie is automagically created between control and collection.
    You can explicitly create one of those collectionview things yourself and this is agreat way to filter and sort.
    You can also use one of those collectionviews to navigate the collection setting the current item in the viewmodel.
    That can be synced in the view so you select an item from the viewmodel.
    I think I probably drifted off topic there somewhat.
    Mvvm is probably different from stuff you've done before.
    It's easier to do a bunch of things using mvvm plus it's what any prospective employer will want.
    Along with tdd/bdd it's industry standard.
    Big tip: learn it.
    You want to avoid showing a user a huge load of data. Not so much for performance reasons but because users can only cope with so much data at a time.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • Different images for spry menu button jpg or gif?

    Hi I have just been reading James Branstons "questions and answers", just what I was looking for many thanks to gramps.
    I am new to dreamweaver and spry and what I am wanting to achieve is a spry menu bar horizontal, I would like to have my own font "Cheri" for the about etc.  To do this would I need to save text as a gif or a jpg?  The jpg looks crisp where as the gif is not so sharp, the jpg has a black background white text, gif white text transparent background, the gif works well with hover, the jpg has the boxed background, if using a jpg do I need to create another file for hover? If so where do I place this in code?
    I did what gramps descibed in James Branstons question works well, but the sub menu boxes have disappeared.
    Hope this all makes sense, hard to explain what you want when you don't know exactly what you're doing. Many many thanks in advance.

    Hi back on the website today just tried out the mouseover and mouseout, I must be doing something wrong as it looks like goulash at the moment, sorry to be a pain and thankyou in advance, as coding is something quite new and frightening for me help is really appreciated.
    Currently code is:
        </script>
        <ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a href="#">about</a></li>
          <li><a href="#">recipes</a></li>
          <li><a href="#">shopping</a></li>
          <li><a href="#">contact</a></li>
        </ul>
      </div>
      <div id="mainNavspace"></div>
    When I added the code below to the about region thats when I made goulash.........
    <li><a class="MenuBarItemSubmenu" href="#"><img name="about" src="jpgs/about.jpg" onMouseOver="about.src='jpgs/about_over.jpg'" onMouseOut="about.src='jpgs/about.jpg'" /></a>
    Thank you for patience in advance, if you could show me how the code should look I would be very grateful, kind regards.

  • Auto Width for Spry Menu

    I've set the width of a (position: absolute) container for a Spry menu so it's width (width: auto) will expand to hold the menu in a single row.
    But sometimes it looks like this in CS3:
    While in browsers it looks OK, like this:
    Is it OK to set the width (or height, for that matter) of the container to auto or or do I have to set a fixed width?

    Please see the answer in the other forum.
    Gramps

  • Problems handling xml data for tree control.

    Hi,
    I have tried using tree control for displaying my xml data
    but I had a problem that i did not have labels in my xml data. A
    sample xml data is attached. So it displays the whole data at each
    level in the tree. The root label will be the entire the xml data
    and then one level down the remaining xml data and so on...
    How do i solve this issue i,e get the tags names itself as
    labels..
    Thanks in advance....

    An update after some efforts..
    Could get the folders perfectly i.e until the level of
    CPUTime perfectly but could not get the leaf: 32 since i used the
    following to set the label.
    I would like to know if there is a way to find out if a node
    is a leaf or folder and according set the label

  • Filter XML Data for Text Fields.

    Hi,
    I'm trying to display a single record out of an XML database
    into dynamic fields in my MovieClip. I need to be able return a
    single record based on the current time. Attached is a sample of my
    XML data.
    I was wondering if this could be acheived with a DataSet
    filterFunction? If it is possible, what code would I need to
    include?
    Finally, do I need to pass my full DataSet to an array or do
    I need to filter first & then pass to an array?
    Thankyou.
    Elton Bernardson.

    There's a pattern that almost every wpf dveloper uses and it's called mvvm.
    Google it, there'll be a shed load of articles.
    It's a passive view pattern in that the view has minimal logic in it.
    The view is your window ( or usercontrol).
    You can add a listboxitem to the listbox.items collection but i would only do  that if it's a very simple static collection.
    You can bind a collection to itemssource and the listbox will create a listboxitem for each things it gets from that collection.
    It creates them using a datatemplate.
    When you do that binding apparently directly to a collection a collectionvie is automagically created between control and collection.
    You can explicitly create one of those collectionview things yourself and this is agreat way to filter and sort.
    You can also use one of those collectionviews to navigate the collection setting the current item in the viewmodel.
    That can be synced in the view so you select an item from the viewmodel.
    I think I probably drifted off topic there somewhat.
    Mvvm is probably different from stuff you've done before.
    It's easier to do a bunch of things using mvvm plus it's what any prospective employer will want.
    Along with tdd/bdd it's industry standard.
    Big tip: learn it.
    You want to avoid showing a user a huge load of data. Not so much for performance reasons but because users can only cope with so much data at a time.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • Query XML data for blanks

    Hi 
    I am try to see if there are any blanks in a node of a table that has xml data in one of the columns. The query I use is returning zero results. Any suggestions?
    Select COUNT(*)from ENTITY
    Where CONVERT(XML, Ent_root_xml, 0 ).value('(//UD_PQ_FLAG/node())[1]', 'VARCHAR(50)')= ' '

    This is a little tricky. When you don't use /text(), looking for space is the right thing. But when you use /text() you should look for NULL:
    DECLARE @x TABLE (id int NOT NULL, x xml NOT NULL)
    INSERT @x (id, x)
       VALUES (1, '<ROOT><Node>This node is intentionally not left blank.</Node></ROOT>'),
              (2, '<ROOT><Node></Node></ROOT>')
    SELECT id
    FROM   @x
    CROSS  APPLY x.nodes('/ROOT') AS T(x)
    WHERE  T.x.value('(Node/text())[1]', 'varchar(23)') IS NULL
    SELECT id
    FROM   @x
    CROSS  APPLY x.nodes('/ROOT') AS T(x)
    WHERE  T.x.value('Node[1]', 'varchar(23)') = ' '
    Erland Sommarskog, SQL Server MVP, [email protected]

  • External XML data for plot chart

    Hi,
    Can you provide the XML equivalent & the corresponding changes to be done in the below plot chart code :
    <?xml version="1.0"?>
    <!-- charts/BasicPlot.mxml -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script><![CDATA[
         import mx.collections.ArrayCollection;
         [Bindable]
         public var expenses:ArrayCollection = new ArrayCollection([
            {Month:"January", Profit:2000, Expenses:1500, Amount:450},
            {Month:"February", Profit:1000, Expenses:200, Amount:600},
            {Month:"March", Profit:1500, Expenses:500, Amount:300},
            {Month:"April", Profit:500, Expenses:300, Amount:500},
            {Month:"May", Profit:1000, Expenses:450, Amount:250},
            {Month:"June", Profit:2000, Expenses:500, Amount:700}
      ]]></mx:Script>
      <mx:Panel title="Plot Chart">
         <mx:PlotChart id="myChart" dataProvider="{expenses}"
         showDataTips="true">
            <mx:series>
               <mx:PlotSeries
                    xField="Expenses"
                    yField="Profit"
                    displayName="Plot 1"
               />
               <mx:PlotSeries
                    xField="Amount"
                    yField="Expenses"
                    displayName="Plot 2"
               />
               <mx:PlotSeries
                    xField="Profit"
                    yField="Amount"
                    displayName="Plot 3"
               />
            </mx:series>
         </mx:PlotChart>
         <mx:Legend dataProvider="{myChart}"/>
      </mx:Panel>
    </mx:Application>

    This does what you want.
    If this post answers your question or helps, please mark it as such.
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="init();">
      <mx:Script>
        <![CDATA[
          import mx.collections.XMLListCollection;
          [Bindable] public var expenses:XMLListCollection;
          private function init():void{
            expenses = new XMLListCollection(XMLList(xml..dataItem));
          private var xml:XML =
            <data>
              <dataItem>
                <Month>January</Month>
                <Profit>2000</Profit>
                <Expenses>1500</Expenses>
                <Amount>450</Amount>
              </dataItem>
              <dataItem>
                <Month>February</Month>
                <Profit>1000</Profit>
                <Expenses>200</Expenses>
                <Amount>600</Amount>
              </dataItem>
              <dataItem>
                <Month>March</Month>
                <Profit>1500</Profit>
                <Expenses>500</Expenses>
                <Amount>300</Amount>
              </dataItem>
              <dataItem>
                <Month>April</Month>
                <Profit>500</Profit>
                <Expenses>300</Expenses>
                <Amount>500</Amount>
              </dataItem>
              <dataItem>
                <Month>May</Month>
                <Profit>1000</Profit>
                <Expenses>450</Expenses>
                <Amount>250</Amount>
              </dataItem>
              <dataItem>
                <Month>June</Month>
                <Profit>2000</Profit>
                <Expenses>500</Expenses>
                <Amount>700</Amount>
              </dataItem>
            </data>;
      ]]></mx:Script>
      <mx:Panel title="Plot Chart">
         <mx:PlotChart id="myChart" dataProvider="{expenses}"
         showDataTips="true">
            <mx:series>
               <mx:PlotSeries
                    xField="Expenses"
                    yField="Profit"
                    displayName="Plot 1"
               />
               <mx:PlotSeries
                    xField="Amount"
                    yField="Expenses"
                    displayName="Plot 2"
               />
               <mx:PlotSeries
                    xField="Profit"
                    yField="Amount"
                    displayName="Plot 3"
               />
            </mx:series>
         </mx:PlotChart>
         <mx:Legend dataProvider="{myChart}"/>
      </mx:Panel>
    </mx:Application>

  • Preformatted RTF string in XML data for BI Publisher merge

    Hi
    I have been presented to the question: Can we send a preformatted RTF text as one of the input fields in XML stream to BI Publisher (mail)merge?
    We're using the MS Word plugin to create a RTF template. Effectively we want to merge RTF text using RTF template.
    I cannot find any documentation stating that it is supported. My tests locally in the MS Word plugin are'nt exactly sucessfull, but there is a number of possible reasons for that.. :-)
    Does anybody know explicitly if it is supported (or not)?
    Regards
    /John

    Hi..
    Obviously the buffer size need to be extend...also its look like you are customizing the report ..so it would be better if you check for data redundancy once.
    you have to increase the size of buffer ....and then let it completly open the xml output file...till its done and then save it and use for preview.
    You have to ask your dba to increase the buffer ...or from sysadmin --->conc manager--->output post processing ...check for the manager and increase the buffer size as well.
    Thanks
    Ratnesh

  • Local xml file for spry usage

    Hi There,
    After my last post about this subject I have been browsing
    the web for an awnser which would enable me to get this done, but
    without any success.
    What I'd like is a method (javascript or php would be fine)
    to get a remote xml feed from flickr to be saved locally for quick
    access by spry.
    I'm not a real coder, so it is hard for me to find out.
    Please can anyone help?
    Kind regards,
    Benjamin

    specht1 wrote:
    > I've read the article, but somehow I do not know what
    you mean...
    The cURL script in that article acts as a proxy for a remote
    XML feed.
    If your hosting company hasn't disabled allow_url_fopen, you
    can create
    an even simpler script:
    <?php
    $url = '
    http://www.example.com/my.xml';
    $remote = file_get_contents($url);
    header('Content-type:text/xml');
    echo $remote;
    ?>
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Custom Map in flash using XML data for dynamic map and point of intrest loading...

    Been some time since I have used Flash for anything...
    I'm working on a little project to dynamically build a map
    and set points of interest on the map. At this time I have the
    (mySQL) data being queried and formatted with PHP and pushing the
    data to Flash as XML.
    In starting the project I'm a bit lost... I mean I have my
    data and a good XML format but as it is I'm lost on parsing the
    data in Flash and assigning its values to movie clips or other...
    I've looked at the Loader Component and the XML Connector
    Component and find I can get that to work at all...
    My second though was to create a single movie clip on stage
    and give it an instance name of "Background" and have it load the
    URL of an image given in the attached XML doc... Node "a_zone" and
    the value given to attribute "image"... But this brings me back to
    square one of not quite understanding Flash and parsing XML... With
    this second idea I would use AS to create a movie clip, set it's X
    & Y cords and load an image to it based on the XML attributes
    listed in the "Gatherable" node (one for each node).
    Any suggestions, examples or related info is welcome...
    Thanks in advance!

    Okay, that really wasn't what I was looking for... But I did
    go back and RTM :-)
    Here's what I have... 1st frame:
    2nd Layer: movieclip with the instance name "currentPicture"
    The image loads into "currentPicture" from the URL given in
    the XML "a_zone" node attribute "image" just fine....
    But I'm not able to grab the attributes of each "Gatherable"
    node it seems... am I missing something or just not pointing to the
    right node?
    I keep getting:
    undefined
    undefined
    undefined
    Error opening URL
    "file:///C|/apache2triad/htdocs/gatherer/flash/undefined"
    Error opening URL
    "file:///C|/apache2triad/htdocs/gatherer/flash/undefined"
    Error opening URL
    "file:///C|/apache2triad/htdocs/gatherer/flash/undefined"

  • ANN: free skins for Spry Menu Bar

    Spry's Menu Bar is a pretty good widget, but it ships with a
    somewhat lame
    CSS. You can download a set of skins that mimic Office 2003
    look and feel:
    http://www.massimocorner.com/spry/menubar/
    I hope it will inspire people to share more skins
    Massimo Foti, web-programmer for hire
    Tools for ColdFusion, JavaScript and Dreamweaver:
    http://www.massimocorner.com

    Excellent, Massimo! Nice to see you here again.... 8)
    Happy Christmas to you over there in chocolate land.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Massimo Foti" <[email protected]> wrote in
    message
    news:gi5rie$puf$[email protected]..
    > Spry's Menu Bar is a pretty good widget, but it ships
    with a somewhat lame
    > CSS. You can download a set of skins that mimic Office
    2003 look and
    > feel:
    >
    http://www.massimocorner.com/spry/menubar/
    >
    > I hope it will inspire people to share more skins
    >
    >
    > --
    > ----------------------------
    > Massimo Foti, web-programmer for hire
    > Tools for ColdFusion, JavaScript and Dreamweaver:
    >
    http://www.massimocorner.com
    > ----------------------------
    >
    >
    >
    >

  • Rounded Corners for Spry menu bar

    Can I use css to style spry menus to make rounded corners?
    Tried inserting a background image into the menu cell in css but
    didn't work. Found tutorials to make rounded corners on text boxes
    but nothing specific to spry menus.
    Also can I make the drop down menu drop "up" rather than
    down?
    Thanks!
    Stacey

    Excellent, Massimo! Nice to see you here again.... 8)
    Happy Christmas to you over there in chocolate land.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Massimo Foti" <[email protected]> wrote in
    message
    news:gi5rie$puf$[email protected]..
    > Spry's Menu Bar is a pretty good widget, but it ships
    with a somewhat lame
    > CSS. You can download a set of skins that mimic Office
    2003 look and
    > feel:
    >
    http://www.massimocorner.com/spry/menubar/
    >
    > I hope it will inspire people to share more skins
    >
    >
    > --
    > ----------------------------
    > Massimo Foti, web-programmer for hire
    > Tools for ColdFusion, JavaScript and Dreamweaver:
    >
    http://www.massimocorner.com
    > ----------------------------
    >
    >
    >
    >

Maybe you are looking for