Using Spry.Data.XMLDataSet. Can xml file name be set to change on calendar date?

I have a website that uses Spry Data XML DataSet to list common pests for the current month. http://www.shspestcontrol.com/
Each month's list of pests is in a separate xml file (e.g. pests-august.xml)
Rather than manually updating the file name each month, can it be setup to automatically change the name
For instance on January 1st, file name changes to pests-january.xml, Feb 1st changes to pests-february.xml. etc.
<script type="text/javascript">
<!--
var dsPests1 = new Spry.Data.XMLDataSet("xml_files/pests-august.xml", "gallery/pests/pest");
//-->
</script>
Any advice if this can be done and if so how to go about doing it would be much appreciated
Thanks, Toni

<script>
var dsPests1 = new Spry.Data.XMLDataSet("pests-september.xml", "gallery/pests/pest");
function setPestsFile(){
    var months = new Array(13);
        months[0]  = "january";
        months[1]  = "february";
        months[2]  = "march";
        months[3]  = "april";
        months[4]  = "may";
        months[5]  = "june";
        months[6]  = "july";
        months[7]  = "august";
        months[8]  = "september";
        months[9]  = "october";
        months[10] = "november";
        months[11] = "december";
    var now = new Date();
    var monthnumber = now.getMonth();
    var monthname = months[monthnumber];
    dsPests1.setURL("pests-"+monthname+".xml");
    dsPests1.loadData();
window.onload = setPestsFile();
</script>

Similar Messages

  • How can I get rid of "_data" behind xml file name

    Hello everybody,
    I use xfa.host.exportData("",0) to export xml file which I cann't appoint the name of xml. After I click the exporting button, a window jumps and fill the xml file name automatically, the name is "PDF file name_data.xml", in Adobe Reader Chinese version, "_data" will be translated by Chinese word, so it is not convenience to unify the method of getting xml.
    My problem is if I can get rid of the postfix "_data" in xml file name? I doulbt maybe I can set in LiveCycle Designer, but I can't find out at present.
    Thanks in advance!
    Enlly

    Hello radzmar
    Thank you for you soon reply!
    I learned about the function exportData(), and my form is not certified, so I use exportData("",0) to export xml file. After I click the export button, it will jump out a window to ask for selecting the path, where users want to save the xml file, and, in this window, LiveCycle will fill xml file name automatically by "xxxx_data" (xxxx is the pdf form name). I just wonder if I can avoid "_data" ?
    Do you have any idea? Thanks!

  • Dynamic XML file names in ODI

    Hi All,
    Is there a way can we call the XML names dynamically.?
    Here is the Scenario,
    I have multiple XML files of same structure to be loaded into an Oracle table.
    I have first created a XML dataserver and have given the exact path and the file name for reversing the XML model for the first time. The JDBC url was,
    jdbc:snps:xml?f=/xml/file/#XML_TEST.FILE_TEST.xml&s=XML_TEST&dod=true&ro=true
    After reversing i have changed the JDBC url of the XML dataserver to,
    jdbc:snps:xml?f=/xml/file/#XML_TEST.var_FILE_NAME.xml&s=XML_TEST&dod=true&ro=true
    I have created a variable *#XML_TEST.var_FILE_NAME* to get all the XML file names.
    After that i tried to view the data from the datastores present under previously reversed XML model, but was getting the following error :
    java.sql.SQLException: While generating the DTD from the XML file, a org.xml.sax.SAXParseException exception occurred saying: Document root element is missing.
    Do I need to change anything in the XML model or in the Datastores?
    Warm Regards,
    VBV

    Since you are using the Variable ,when you right click and view datastore its missing the required path of the file, as value of the variable is not determined , to do so you need to either refresh or set the variable and call the interface or other ODI objects and in loop keep reading XML files one by one and that should work.

  • Problem in use xmlgen.insertXML to insert XML file to Object Viewse

    I am trying to update XML file to Object View but it failed. Refer to the steps that I was doing.
    1) Use utl_file.get_line to read XML file which I generated (It is no problem)
    2)The xml data is
    <?xml version="1.0" ?>
    - <ROWSET>
    - <ROW num="1">
    <PK_NO>305</PK_NO>
    <ACC_NAME>PAPERS AND CLIPS</ACC_NAME>
    <FROM_NAME>MB METAL PTE LTD</FROM_NAME>
    <MAS_NO>990015</MAS_NO>
    <MAS_DATE>2000-04-07 15:47:52.0</MAS_DATE>
    <CURR_CODE>SGD</CURR_CODE>
    <MAS_CODE>WRFQ</MAS_CODE>
    <REMARK>SADKJAS</REMARK>
    - <LINEITEMLIST_NTAB>
    - <LINEITEMLIST_NTAB_ITEM>
    <ITEM_NO>1</ITEM_NO>
    <STK_C>2506401</STK_C>
    <SP_STK_C>H282828</SP_STK_C>
    <STK_NAME>STICK-ON-NOTES - 11110 1.5, 12 100 SHEET PADS</STK_NAME>
    <UOM>SET</UOM>
    <QTY>10</QTY>
    <SALES_PRICE>95.50</SALES_PRICE>
    <REMARK>SADKJAS</REMARK>
    </LINEITEMLIST_NTAB_ITEM>
    - <LINEITEMLIST_NTAB_ITEM>
    <ITEM_NO>2</ITEM_NO>
    <STK_C>7706001</STK_C>
    <SP_STK_C>H282828</SP_STK_C>
    <STK_NAME>FACESHIELD/EYE PROT CLEAR GLASS WTR PLATE, STANDARD DREW</STK_NAME>
    <UOM>PCS</UOM>
    <QTY>1</QTY>
    <SALES_PRICE>100</SALES_PRICE>
    <REMARK>SADKJAS</REMARK>
    </LINEITEMLIST_NTAB_ITEM>
    </LINEITEMLIST_NTAB>
    </ROW>
    </ROWSET>
    3) From Object View, I generated xml file is
    - <ROWSET>
    - <ROW num="1">
    <PK_NO>2</PK_NO>
    <ACC_NAME>PAPERS AND CLIPS</ACC_NAME>
    <FROM_NAME>MB METAL PTE LTD</FROM_NAME>
    <MAS_NO>990015</MAS_NO>
    <MAS_DATE>2000-06-07 00:00:00.0</MAS_DATE>
    <CURR_CODE>SGD</CURR_CODE>
    <MAS_CODE>WRFQ</MAS_CODE>
    - <LINEITEMLIST_NTAB>
    - <LINEITEMLIST_NTAB_ITEM>
    <ITEM_NO>1</ITEM_NO>
    <STK_C>2506401</STK_C>
    <STK_NAME>STICK-ON-NOTES - 11110 1.5,X2 12 100 SHEET PADS</STK_NAME>
    <UOM>SET</UOM>
    <QTY>1</QTY>
    <SALES_PRICE>10</SALES_PRICE>
    </LINEITEMLIST_NTAB_ITEM>
    </LINEITEMLIST_NTAB>
    </ROW>
    - <ROW num="2">
    <PK_NO>4</PK_NO>
    <ACC_NAME>ABC</ACC_NAME>
    <FROM_NAME>VBF</FROM_NAME>
    <MAS_NO>99200</MAS_NO>
    <MAS_DATE>2000-01-04 00:00:00.0</MAS_DATE>
    <CURR_CODE>SGD</CURR_CODE>
    <MAS_CODE>DSDS</MAS_CODE>
    <REMARK>WRFQ</REMARK>
    <LINEITEMLIST_NTAB />
    </ROW>
    </ROWSET>
    3) I use INSTEAD OF trigger for Object View to insert the data to database.
    I got the message is:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException:5.
    Anybody can give me the advise for that.
    null

    If you have the ftp server at 8080 running (9iR2 only) the simples way is to upload it to the database through that server. You can then do whatever you want using the xdburitype() procedure.
    Below is an excerpt of a script I use to register XML schema's (I've got some very long ones, about 150K). It should work with "any" file..
    begin
         dbms_xmlschema.registerSchema (
              schemaURL => 'http://www.agralin.nl/WebQuery/ns/&1',
              schemaDoc => xdburitype('/age/&1..xsd'),
              local => TRUE,
              genTables => FALSE,
              genbean => FALSE,
              genTypes => TRUE,
              force => FALSE,
              owner => 'AGE'
    end;

  • Set xml file name

    Dear,
    I want to set the name of the xml sended by mail.
    I use a botton for this, cane help me to set the name of this file before attachement !
    Thanks

    I know that, but i need to set the xml file name sent by mail with information typed in a text field.
    For exemple un have a PDF file named : myPdf.pdf
    And each user of this pdf file will type in a text feld his name so the xml file should be named : brain.xml and not myPdf.xml
    Thanks

  • How to use Xerces to validate an XML file against a DTD

    Hi, can anybody tell me how to use Xerces to validate an XML file against a DTD. its urgent. post some sample code. it would be helpful for my project. isupposed to use SAX parser(Xerces)
    Thanx in advance

    Come on, I googled "xerces validate" and the first link is the Xerces FAQ:
    http://xerces.apache.org/xerces-j/faq-general.html
    And of course "how to validate" is a Xerces FAQ. Help yourself by doing a little research instead of waiting for other people.

  • How to find PG.xml file name and path associated with a FUNCTION

    Hi,
    I am having a function:IRC_VIS_HOME_PAGE with Web HTML value as below:
    OA.jsp?akRegionCode=IRC_VIS_HOME_PAGE&akRegionApplicationId=800&OAPB=IRC_BRAND
    How to find PG.xml file name and path assoicated with above funtion.
    Thanks,
    ashok

    Ashok,
    Function IRC_VIS_HOME_PAGE will have 2 parameter defined for it which are OASF and OAHP where
    OASF=<SelectedFunctionName> - this tells the Framework to select this function in the given "Home Page" menu context.
    OAHP=<HomePageMenuName> - this is used ONLY with the OASF parameter, and it is used to establish the current menu context. It should point to a "Home Page" menu.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Pages-when using template for envelopes can you import names/address from address book

    When using templates for envelopes can you import names/address from the address book?

    Drag the VCard from Address Book onto the open envelope template.
    If you want mutiple addresses make a Group of those in Address Book and drag the Group icon onto the Pages template.
    Peter

  • Quicken data file names are mysteriously being change on my iDisk

    within the last couple of days my Quicken data file names are mysteriously being change on my iDisk which seem to make them inaccesable.  Not sure why this is happening

    within the last couple of days my Quicken data file names are mysteriously being change on my iDisk which seem to make them inaccesable.  Not sure why this is happening

  • I have Premier Elements 8.  I recorded some 45 minute lectures on a Sony Camcorder at 17 Mbps.  The resulting, edited file size is about 6.3 GB -- too big to record on a 4.7 GB DVD-R disc.  Using Adobe PE 8, can the file size be reduced in some way to end

    I have Premier Elements 8.  I recorded some 45 minute lectures on a Sony Camcorder at 17 Mbps.  The resulting, edited file size is about 6.3 GB -- too big to record on a 4.7 GB DVD-R disc.  Using Adobe PE 8, can the file size be reduced in some way to end up less than 4.7 GB (I realize image quality may be less htan the original)?

    pault
    What are you going for....DVD-VIDEO Widescreen on DVD disc or AVCHD format on DVD disc?
    Are you doing your burn to disc with a check mark next to "Fit Content To Available Space" in the burn dialog?
    When you have the DVD 4.7 GB/120 min in the burner tray and are in the burn dialog ready to hit Burn, what does the burn dialog quality area show for Space Require and Bitrate with and without the check mark next to "Fit Content To Available Space"?
    Just in case mention....the DVD disc with the 4.7 GB/120 min in reality is 4.38 GB.
    The goal is to find out if you are overlooking the "Fit Content To Available Space" option in the burn dialog. Depending on the circumstances to be defined, use of that option does not necessarily mean a compromise in the end product quality.
    Let us start here and then move forward based on the details of your reply.
    Thank you.
    ATR

  • What do I do with this error message: To use this library, make sure its file permissions are set correctly.

    So I cannot even access the application. It was working fine yesterday and today I get this error message:
    To use this library, make sure its file permissions are set correctly.
    I have changed nothing. All the pictures are there on the computer. Help?!

    Reboot.  Close any programs which open at start-up.  Run Disk Utility (you can type this in the Spotlight search field at the right end of your Menubar).
    In Disk Utility, select your drive from the list on the left, and click "Repair Disk Permissions".  This will take a few minutes, but should be less than ten.
    Reboot.
    Try to open your Library in Aperture.  What happens?

  • Aperture cannot access this library" followed by "To use this library, make sure its file permissions are set correctly."

    Hi,
    I am completely confused. I use aperture everyday and today when I tried to open it I got the following message " aperture cannot access this library" then it said to use this library , make sure its file permissions are set correctly"
    So i read a bunch of posts and opened aperture while holding down option and command and repaired the file permissions.  it did nothing, when I tried to open aperture I received the same message.   So then i tried opening it while holding down just the option key. This brought up all of my libraries but when I chose the library i use daily the same message came up.
    Does anyone know how to fix this and/ or why it is happening?
    Thank you

    No idea how to check the format, not familiar with Drobo products. Does the drive show up in Disk Utility? If so you should be able to see how it is formatted there.
    How long has this setup been in use?
    Aperture libraries have to be on locally connected drives formatted as OS Extended as per Apple (see Format external drives to Mac OS Extended before using with Aperture for example). While Aperture may work with other setups there is always the possibility that the library will become unusable at any point in time with no warning.
    Try to find out the format of the drive and post back. Maybe something can be done but from the error messages you are getting I'm thinking the best course of action will be to restore from backups onto a correctly formatted drive.
    regards

  • Can XML files be used for data?

    We have an XML file that contains all of the data we want to use for a model.  Is there any way that this can be used instead of a database query?

    If you find a JDBC driver for XML, then yes.
    Check out the Visual Composer WIKI under JDBC:
    https://wiki.sdn.sap.com/wiki/display/VC/Connectivity
    and also
    Where can I find JDBC drivers?
    https://wiki.sdn.sap.com/wiki/display/VC/JDBC+Drivers

  • Error message when using Spry Data set with XML

    Hi,
    I have what i see as a big problem, might just be me being
    dumm, but here we go.
    When I try to use the feature of spry XML Data Set and insert
    spry table I get error message when trying it in IE 7.
    There are even a problem when I use fireworks automated slide
    show function, where you can choose to use the Spry/XML gallery
    feature.
    The error message I get everytime (incl the auto gallery in
    fireworks) is:
    The tag: "html" doesn't have an attribute: "xmlns:spry" in
    currently active versions.[XHTML 1.0 transitional]
    The tag: "div" doesn't have an attribute: "spry:region" in
    currently active versions.[XHTML 1.0 transitional]
    The tag: "th" doesn't have an attribute: "spry:sort" in
    currently active versions.[XHTML 1.0 transitional]
    and so on.
    What´s wrong?!

    Hello barvid,
    Ok, let's take each problem step by step:
    1. The first error you see in the browser: " Exception while
    loading ..." normally appears when you try to load files that are
    not permitted by the browser security model. This means the XML
    file you try to load is located on a different server than your
    HTML which is not allowed. The browser is not permitting to load
    any files that are not in the same domain as the current page
    because of the complex security risks. You'll have to either get
    the XML file from its original location and save it in your website
    or use a proxy on your web server that should request that file
    from the external server and send it to the browser as an XML from
    the same domain as the HTML origin.
    1.2 The "Exception while loading ..." error you see is a
    generic error and my previous advise is based on my experience. In
    case this is not your scenario you'll have to open the SpryData.js
    and around line 112 you'll see the following code:
    Spry.Debug.reportError("Exception caught while loading " +
    url + ": " + e);
    Please change this line with the following line of code:
    Spry.Debug.reportError("Exception caught while loading " +
    url + ": " + (e.message?e.message:e));
    to obtain a more verbose error message that may clarify the
    reasons of your errors.
    2. The problems you describe are not browser errors but they
    are w3c validation errors. At this point the XHTML standard allows
    every application that define custom namespace attributes to also
    link a DTD to the page so the page to continue to be valid.
    Unfortunately at this point this feature is not correctly supported
    by the FF and IE so we wrote an articles about how you should
    link
    the Spry DTD to your page so the validator understand the
    custom attributes Spry use. You'll find inside the full description
    of the problems and all the technical details you'll need to know
    to solve this issue.
    Regards,
    Cristian

  • Using the regex to match the file name with date time

    Hello all,
    currently I had problem to match the following file name with the date time. Of course I can use this regex like ""(\\\\w+|.+).(zip)" to match it. However in the current application i need to parse the file name and get the current date time to check if it is matched. Does anyone have good idea?
    {code}
    testfile10-08-09-2008-08-21-04-24-0443.zip
    testfile11-08-09-2008-08-22-04-24-0441.zip
    {code}
    thanks in advanced!

    lauehuang wrote:
    Hello all,
    currently I had problem to match the following file name with the date time. Of course I can use this regex like ""(\\\\w&#43;|.&#43;).(zip)" to match it.That regex doesn't make a lot of sense:
    - with "\\\\w" you probably meant "\\w";
    - "\\w&#43;|.&#43;" doesn't make sense: you can simply do ".&#43;" in that case;
    - ".(zip)" will also match the string "%zip" or "Ezip".
    However in the current application i need to parse the file name and get the current date time to check if it is matched. I don't know what you mean by that.

Maybe you are looking for

  • How do I utilize multiple instances of firefox utilizing different credentials, and retain full functionality.

    Recently my company made some "in the name of security" changes. One of these was to give local IT two windows accounts, one for e-mail and day to day activities, and the other for when administrative privileged is required. I have been using Firefox

  • Energy Saver still crashing MacBook Pro AFTER 10.9.4 update...

    It's simple. Display Sleep and Computer Sleep turned off = no crashes. Computer Sleep turned on = crashes. Anyone else still experiencing this?

  • Colors in Adobe Reader 9.3.3

    Hello! I have a problem with colors in Adobe Reader 9.3.3 (I haven't checked earlier versions) on Win XP when displaying certain PDFs like the one in this link http://www.fileden.com/files/2010/8/11/2938999//RlColorDoc.pdf The colors on page 3 are of

  • Do I need a mouse?

    I am about to buy my first MacBook online from Apple?  Do I need a mouse, or is the trackpad really so good that I won't need a mouse? Thanks!

  • Generate FI doc during order settlement

    Hi Experts, Please share any enchancement (BAPI, exit) to generate accounting document (doc type ST) by reference to CO document? example: -CO- Dr. Material Operations(Cost Center) 12 Cr. Material Operations(Order) 12 -FI- generated by enhancement Dr