XML / Actionscript Question

Hi --
I am trying to add a weather "widget" to my website. I am
pulling the XML forcast using this link:
Weather
XML
I get the XML back ok, however the XML has data names like
"weather-icon", and others with hypens. When I attempt to read the
data I get an error regarding an invalid property, "icon". I am
assuming this is because the hyphen is some sort of "reserved"
character?
If anyone can suggest how I can access this information that
would be great!
Thanks
Rich

I assume you're using AS3 and trying to read the nodes using
E4X dot syntax,
i.e.
node.weather-icon
node.weather-icon[0]
node.weather-icon[1]
etc...
Try using
node.child("weather-icon")
node.child("weather-icon")[0]
node.child("weather-icon")[1]
etc...

Similar Messages

  • Basic Actionscript question

    Forgive me, I'm really new to this.
    Ok, so I'm wanting to have ads radomly play before people watch a video on my site.Is there a way to write the script for this and place it in the xml or do I have to something differently.
    I already have the video up on our site. So I'm just not sure how I "connect" the actionscript and xml that way it plays the commercial before the video.
    Do I have to build a new player and everything to do this? I've never built a player before, so if I don't have to, I'd rather not. Thanks.

    This is not a basic question but rather extensive topic.
    Yes, there are ways to connect anything to XMLs. But you have to write your own application/player that will contain the logic to do that.
    Also, there are open source player out there that may do what you ask.

  • Basic  XML Publisher Question: How to access tags in the higher levels?

    Hi All,
    We have a basic question in XML Publisher.
    We have a xml hierarchy like below:
    <CD_CATALOG>
    <CATALOG>
    <CAT_NAME> CATALOG 1</CAT_NAME>
    <CD>
    <TITLE>TITLE1 </TITLE>
    <ARTIST>ARTIST1 </ARTIST>
    </CD>
    <CD>
    <TITLE> TITLE2</TITLE>
    <ARTIST>ARTIST2 </ARTIST>
    </CD>
    </CATALOG>
    <CATALOG>
    <CAT_NAME> CATALOG 2</CAT_NAME>
    <CD>
    <TITLE>TITLE3 </TITLE>
    <ARTIST>ARTIST3 </ARTIST>
    </CD>
    <CD>
    <TITLE> TITLE4</TITLE>
    <ARTIST>ARTIST4 </ARTIST>
    </CD>
    </CATALOG>
    </CD_CATALOG>
    We need to create a report like below:
    CATALOG_NAME     CD_TITLE     CD_ARTISTCATALOG 1     TITLE1     ARTIST1
    CATALOG 1     TITLE2     ARTIST2
    CATALOG 2     TITLE3     ARTIST3
    CATALOG 2     TITLE4     ARTIST4
    So we have to loop at the level of <CD> using for-each CD. But when we are inside this loop, we cannot access the value of CAT_NAME which is at a higher level.
    How can we solve this?
    Right now, we are using the work-around of set_variable and get_Variable. We are setting the value of CAT_NAME inside an outer loop, and using it inside the inner loop using get_variable.
    Is this the proper way to do this or are there better ways to do this? We are running into troubles when the data is inside tables.

    you can use
    <?../CAT_NAME?>copy past to your template
    <?for-each:CD?> <?../CAT_NAME?> <?TITLE?> <?ARTIST?> <?end for-each?>

  • XML PUBLISHER Questions

    Hi All,
    Following questions restrict to use of functionalities of XMLP:
    1. What could be functionality of Delivery manager of XMLP?
    2. How could process Delivery manager an user request?
    3. Delivery manager is full of Java API’s that means apps developer must know java. Am I correct? If it is Yes, what are java concepts need know so that developer can do his job successfully?
    4. What could be sub-template concept in XMLP? Please give one practical scenario.
    5. One scenario: I want generate group of invoices in PDF format and each invoice must generate in fresh page.
    XML Input to Template: Report output (output format in XML)
    Input parameters: Customer or Print date (i.e. all invoices of specified customer should populate)
    I could not able to generate each invoice in fresh page. Is it possible through XMLP?
    6. XSL: is language and used for transformation i.e. one form document to another form document (xml =>XHTML) am I correct?
    7. When do we go for XSL implementation in XMLP? Please provide example.
    8. Where do we write XSL code in template? Assume template I am using RTF form field method.
    Any help would appreciate.
    Thanks,
    [email protected]
    Date: 13-Aug-07.
    Hi All,
    What could be the difference between delivery manager and Document Processor engine?
    Could we use both for deliver XMLP documents to different Delivery channels?
    Thanks,
    [email protected]
    Message was edited by:
    user553699

    Hi All,
    I am also facing new problem while i am going to register template in following environment:
    Oracle applications version: 11.5.10.2
    XML publisher Version: 5.0.0
    My file size: 65 KB with out image
    363 KB with company logo
    The RTF used English language characters and want to register for English – USA
    My RTF template works fine in preview mode in Word. I go to upload it via XML Publisher Adminstator and I get a screen that just says "You have encountered an unexpected error. Please contact the System Administrator for assistance."
    What? The only option is Log out. Is there a way to validate my template to know what could possibly be wrong with it?
    Please let me know if any other information require about RTF template.
    Any help would appreciate.
    Thanks,
    Sai.Krishna @cavaya.com
    P.S: I do not know how to attach file in forum. please give me information how to attach file form so that i can attach RTF file.

  • XML/XSLT question

    At the moment my java servlet just takes content from an ArrayList and populates html blocks that get concatenated and thrown to the client as a html page. This is not the best way to do things because the java code and html vocabulary is interspersed.
    In a bid to seperate the presentation(html code) from the logic(java code) I am turning to XSLT. From my research this takes as input an XML file that contains the content. But how do you insert the content? Is there a standard way? When the tranformation from XML to html is complete, how do you hand back the resulting html page within the java application? Thanks in advance.

    One solution would be to use a JSP. It can retrieve the ArrayList from the Servlet and use it to build HTML. At least that way the mixture of HTML and Java is minimized in the source form. (Behind the scenes, the JSP is turned into a Servlet, so the mixture is still there, it is just not as visible.)
    Another choice is to use DOM or JDOM to create the Html content using Element objects to create tags. The main advantage of that over doing "
    ...out.println( "<h1>...</h1>);
    is that it makes sure the closing tags match, and empty tags are properly coded.
    In answer to your direct question, there is no standard for how to code data into XML so you can run an XSLT transform to convert it into HTML. It also mixes Java logic and XML in the same file. You need to choose your poison.
    Dave Patterson

  • XML Schema questions

    Question 1:
    If I have a many to many relationship that I want to display within multiple tables.  Is there a straightforward way to bind that?
    An example would be an automobile that use similar parts (seats etc).  I dont think livecycle supports keys
    So the xml looks like
    <orderCatalog>
      <automobile>
         <modelNumber>auto1</modelNumber>
          ... year etc
      </automobile>
      <part>
             <partNo>part1</partNo>
      </part>
       <joinAutoPart>
              <modelNumber>auto1</modelNumber>
              <partNo>part1</partNo>
       </joinAutoPart>
    </orderCatalog>
    I would like to point this to
    Subform pointing to joinAutoPart
    Header field pointing to automobile (with model number and name)
    Table with part information pointing to partNo (with partName and partNo and price)
    That way I would have a table per automobile with all of the individual parts listed
    Question 2:
    Can reader load an xml file over the internet by pressing a button like loadXML?
    Question 3: non xml related
    Is there a way to save a link from a table row to another table row
    Using the above example if I had multiple auto tables with multiple parts.  The user selects a part which I add to an order table.
    I would like to highlight that field showing they have ordered the part and grey out the button.
    However, if they remove the item from their order I would like to add it back without having to search every field in every table to find the part number.

    Thanks again for the response.
    Q1: If I have a join table - given that I have a many - to - many relation with multiple autos and multiple parts
    How do I connect the partNo to the description in the table from the xml
    If I create a table that I want to have
    <orderCatalog>
      <automobile>
         <modelNumber>auto1</modelNumber>
         <modelName>Mustang</modelName>
          ... year etc
      </automobile>
      <part>
             <partNo>part1</partNo>
             <partName>Headrest</partName>
      </part>
       <joinAutoPart>
              <modelNumber>auto1</modelNumber>
              <partNo>part1</partNo>
       </joinAutoPart>
    </orderCatalog>
    Automobile Model #,  Make, ....
    PartNo |  Part Description | Order Button
    I can bind joinAutoPart table to the Automobile header, but how to I convert that to a text Model Name vs a number
    I can join PartNo to the entries of a table, but can I fill the descriptions of each
    I want to do select partdescription, colorOptions, etc from partTable where PartNo = part1 then use those values - using binding or xml syntax
    I can reform the xml from my data to be the following, but this requires a lot of duplicate data and is very error prone to have one part name or number that is one off
    <automobile>
        <partList>
             <part>
                     <partNumber>part1<partNumber>
                     <partName>partName</partName>
             </part>
        </partList>
    </automobile>
    Q2: ok
    Ideally, I would like to have a dropdown box where the user selects say a  model name.  Then it builds a list of tables from an xml file - so there are a few common tables - like t-shirts, coffee cups etc that would show up on every form and the rest are dynamic.
    For ODBC, am I correct in thinking that the link has to be established at the client to the server outside of reader before a connection can be made within reader?
    Q3:  I am doing the add programatically, but if I have a part number from a built xml with many tables - is there a way to identify which table it is coming from?
    I don't on the order form have  | ModelNumber | PartNumber, so I don't have an easy way to reference back. And if I did I would still have to do multiple linear searches.  I assume the performance wouldn't be too bad, but it is not pretty.
    i = 0;
    j=0;
    while(i < (ModelTableForm.count-1))
       if (xyz.resolveNode("foo[" + i + "]").modelNumberField.rawValue == modelNumber)
              j = 0;
             while(j< (abc.resolveNode("bar[" + i + "]").count-1))
                 if(abc.resolveNode("bar[" + i + "]").partNumberField.rawValue == partNo)
                         abc.resolveNode("bar[" + i + "]").addButton.prescence="visible"
       i++;
    I was hoping for an extra field or way to extend the row object I could add referringNode or something to that effect and just say OrderRow.refferingNode.button.presence = "visible"
    I think I found one way to get around this.  I think I can create 0 width colums for indexes to the tables
    That way I could say  xyz.resolveNode("foo[" + modelIndex + "]").abc.resolveNode("bar[" + partIndex + "]")

  • XML/XPath question--how to select a range of elements with XPath?

    Hi there,
    I have an XML DOM in memory. I need to do hold it and issue only parts of it to my client app in "pages". Each page would be a self-contained XML doc, but would be a subset of the original doc. So for instance the first page is top-level elements 1-5. 2nd page would be 6-10 etc. Is this solution best solved with XPath? If not, what's the best way? If so, I have the following question:
    Is there a way to use XPath to select a range of nodes based on position within the document? I know I can do an XPath query that will return a single Node based on position. So for example if I wanted the first node in some XML Book Catalog I could do XPathAPI.selectSingleNode(doc, "/Catalog/Book[position()=1]"); I could wrap the previous call in a loop, replacing the numeric literal each time, but that seems horribly inefficient.
    Any ideas? Thanks much in advance!
    Toby Buckley

    Your question is about marking a range of cells. 99% of the code posted has nothing to do with this. If you want to create a simple table for test purposes then just do:
    JTable table = new JTable(10, 5);
    JScrollPane scrollPane = new JScrollPane( table );
    getContentPane().add( scrollPane );
    In three line of code you have a simple demo program.
    When I leave the mouse button again, these bunch/range of cells shall stay "marked". table.setCellSelectionEnabled( true );
    and I'd like to obtain, say, a vector of a vector containing just those data marked beforeUse the getSelectedRows() and getSelectedColumns() methods for this information. I would suggest you create a Point object to reflect the row/column position and then add the point to an ArrayList.

  • Xml href question

    hello........i have been researching this for a while now and
    still can't get it to work. does anyone know how to make an <a
    href> tag work in an xml file? I have a photo gallery flash file
    that is referencing this xml file:
    </image>
    <image>
    <pic>images/image_2.jpg</pic>
    <thumb>images/thumb_2.jpg</thumb>
    <title>Project 2</title>
    <desc>whatever text</desc>
    </image>
    i tried placing this code <![CDATA[ <a
    href="www.google.com" target="blank">google</a>]]> in
    the <desc> tag. it did not work.
    does anyone know what exactly needs to go into the xml file
    and the flash actionscript to make this work? any help is greatly
    appreciated. i am at a loss. thanks.

    quote:
    Originally posted by:
    Newsgroup User
    I threw this together and it works. You might want to compare
    it with your
    code. Few things to note:
    1. txtLoadText.html=true
    2. Assign the listener to the XML object before loading the
    xml file.
    3. Consider using the more elegant XPathAPI to retrieve
    nodes.
    data.xml:
    <?xml version="1.0" ?>
    <image>
    <pic>images/image_1.jpg</pic>
    <thumb>images/thumb_1.jpg</thumb>
    <title>Project 1</title>
    <desc><![CDATA[<a href='
    http://www.adobe.com'
    target='_blank'>CLICK
    ME</a> ]]></desc>
    </image>
    // FLA with one instance of TextField named txtLoadText
    // frame 1
    stop();
    //XML data
    var LoadedFileSize:Number = 0; //Size of loaded data
    var TotalFileSize:Number = 0; //Total file size
    var PercentageFileSize:Number = 0; //Percentage =
    (Loaded/Total) * 100
    //Movie
    var LoadedMovieSize:Number = 0; //Size of loaded data
    var TotalMovieSize:Number = 0; //Total file size
    var PercentageMovieSize:Number = 0; //Percentage =
    (Loaded/Total) * 100
    var Percentage:Number = 0;
    txtLoadText.html=true;
    //Set the preloader text
    txtLoadText.htmlText = "loading data... " + Percentage + "%";
    var xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    //Function called on XML data load completion
    function loadXML(loaded:Boolean) {
    if (loaded) {
    txtLoadText.htmlText =
    this.firstChild.childNodes[3].firstChild.nodeValue;
    else {
    txtLoadText.htmlText = "XML file failed to load!";
    xmlData.load("data.xml");
    This worked. The link is functioning properly in the
    <desc> tag but now it does not want to load the thumbs or
    images?? The <title> does not show up either. Any
    thoughts?

  • Image actionscript question

    I have created an new Image using actionscript
    var img:Image = new Image();
    img.source = images[imageViewer.horizontalScrollPosition].source;
    img.maintainAspectRatio = true;
    img.scaleContent = true;
    img.autoLoad = true;
    I am trying to find out how to create a Fade effect when the image createCompleted, simular to the completeEffect in MXML. Anyone have a simple example. I would really appreciate it....
    Thanks

    Ok I have it working now with one exception. If the images are not all the same size then I can't seem to center them in my imgContainer container. I need to be able to do something like img.horizontalCenter=0;  and img.verticalCenter=0; but Flex does not recognize this.
    Working example www.murphysmusicoftexas.com
    Please let me know what you think?
    img = new Image;
    img.setStyle("showEffect",effects)
    img.addEventListener(Event.COMPLETE,onImageLoadComplete);
    img.source = images[imageViewer.horizontalScrollPosition].source;
    img.maintainAspectRatio = true;
    img.scaleContent = true;
    img.autoLoad = true;
    img.visible = false;
    img.width = this.width;
    img.height = this.height;
    img.horizontalCenter = 0;
    img.verticalCenter = 0;
    Example
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"
    title="Our Store"
    width="720" height="460"
    horizontalAlign="center"
    verticalAlign="top"
    horizontalScrollPolicy="off"
    verticalScrollPolicy="off"
    creationComplete="imageService.send()" >
    <mx:Script>
            <![CDATA[
            import mx.events.EffectEvent;
            import mx.events.FlexEvent;
            import mx.controls.Image;
    import mx.events.SliderEvent;
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    import mx.controls.Alert;
    [Bindable]
    private var effectTimer:int;
    [Bindable]
    private var moveStartDelay:int;
    [Bindable]
    private var moveXFrom:int;
    [Bindable]
    private var moveXTo:int;
    [Bindable]
    private var moveYFrom:int;
    [Bindable]
    private var moveYTo:int;
    [Bindable]
    private var moveDuration:int;
    [Bindable]
    private var fadeStartDelay:int;
    [Bindable]
    private var fadeDuration:int;
    [Bindable]
    private var metadata:ArrayCollection;
    [Bindable]
    private var images:ArrayCollection;
    [Bindable]
    private var currentSlide:Object;
    private var timer:Timer;
    private var img:Image;
    private function resultHandler(event:ResultEvent):void {
    metadata = event.result.root.metadata.control;
    this.effectTimer = metadata.getItemAt(0).effectTimer.valueOf();
    this.moveStartDelay =  metadata.getItemAt(0).moveStartDelay.valueOf();
    this.moveXFrom =  metadata.getItemAt(0).moveXFrom.valueOf();
    this.moveXTo = metadata.getItemAt(0).moveXTo.valueOf();
    this.moveYFrom = metadata.getItemAt(0).moveYFrom.valueOf();
    this.moveYTo = metadata.getItemAt(0).moveYTo.valueOf();
    this.moveDuration = metadata.getItemAt(0).moveDuration.valueOf();
    this.fadeStartDelay = metadata.getItemAt(1).fadeStartDelay.valueOf();
    this.fadeDuration = metadata.getItemAt(1).fadeDuration.valueOf();
    this.width = metadata.getItemAt(2).width.valueOf();
    this.height = metadata.getItemAt(2).height.valueOf();
    images = event.result.root.images.image;
    init();
    private function init():void {
    timer = new Timer(effectTimer);
    timer.addEventListener(TimerEvent.TIMER, onTimer);
    firstImage();
    startTimer();
    private function onTimer(e:TimerEvent):void {
    nextImage();
    private function startTimer():void {
    timer.start();
    private function stopTimer():void {
    timer.reset();
    private function mouseOver():void {
    timer.stop();
    private function mouseOut():void {
    timer.start();
    private function firstImage():void {
    img = new Image;
    img.setStyle("showEffect",effects)
    img.addEventListener(Event.COMPLETE,onImageLoadComplete);
    img.source = images[imageViewer.horizontalScrollPosition].source;
    img.maintainAspectRatio = true;
    img.scaleContent = true;
    img.autoLoad = true;
    img.visible = false;
    img.width = this.width;
    img.height = this.height;
    imgContainer.addChild(img);
    private function prevImage():void {
    var pos:int = imageViewer.horizontalScrollPosition-1;
    var min:int = 0;
    var value:int = Math.max(min, pos);
    imageViewer.horizontalScrollPosition = value;
    img = new Image;
    img.setStyle("showEffect",effects)
    img.addEventListener(Event.COMPLETE,onImageLoadComplete);
    img.source = images[imageViewer.horizontalScrollPosition].source;
    img.maintainAspectRatio = true;
    img.scaleContent = true;
    img.autoLoad = true;
    img.visible = false;
    img.width = this.width;
    img.height = this.height;
    imgContainer.addChild(img);
    if(imgContainer.numChildren > 2){
    imgContainer.removeChildAt(0);
    private function nextImage():void {
    var pos:int = imageViewer.horizontalScrollPosition+1;
    var max:int = imageViewer.maxHorizontalScrollPosition;
    var value:int = Math.min(pos, max);
    if(value >= max){
    value = 1;
    imageViewer.horizontalScrollPosition = value;
    img = new Image;
    img.setStyle("showEffect",effects)
    img.addEventListener(Event.COMPLETE,onImageLoadComplete);
    img.source = images[imageViewer.horizontalScrollPosition].source;
    img.maintainAspectRatio = true;
    img.scaleContent = true;
    img.autoLoad = true;
    img.visible = false;
    img.width = this.width;
    img.height = this.height;
    imgContainer.addChild(img);
    if(imgContainer.numChildren > 2){
    imgContainer.removeChildAt(0);
    private function onImageLoadComplete(event:Event):void {
    Image(event.currentTarget).visible = true;
    Image(event.currentTarget).useHandCursor = true;
            ]]>
        </mx:Script>
    <mx:Parallel id="effects" >
    <!--<mx:Move  id="mode" startDelay="{moveStartDelay}" xFrom="{moveXFrom}" xTo="{moveXTo}" yFrom="{moveYFrom}" yTo="{moveYTo}" duration="{moveDuration}" />-->
    <mx:Fade  id="fade" startDelay="{fadeStartDelay}" duration="{fadeDuration}"/>
    </mx:Parallel>
        <mx:HTTPService id="imageService" url="components/store/images.xml" result="resultHandler(event)" showBusyCursor="true" />
        <mx:Canvas width="{this.width}" height="{this.height}" >
    <mx:Canvas id="imgContainer" width="{this.width}" height="{this.height}" verticalCenter="0" horizontalCenter="0"  horizontalScrollPolicy="off" verticalScrollPolicy="off"  mouseOver="mouseOver()" mouseOut="mouseOut()"  buttonMode="true" useHandCursor="true">
    </mx:Canvas>
    </mx:Canvas>
    <mx:HorizontalList
    id="imageViewer"
    dataProvider="{images}"
    visible="false"/>
    </mx:Panel>
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
    <metadata>
    <control effectTimer="6000" moveStartDelay="0" moveXFrom="2000" moveXTo="0" moveYFrom="0" moveYTo="0" moveDuration="3000"/>
    <control fadeStartDelay="0" fadeDuration="3000"/>
    <control width="720" height="488"/>
    </metadata>
    <images>
    <image title="" source="components/store/images/DSC_0006.jpg"  description=""/>
    <image title="" source="components/store/images/DSC_0007.jpg"  description=""/>
    <image title="" source="components/store/images/DSC_0008.jpg"  description=""/>
    <image title="" source="components/store/images/DSC_0009.jpg"  description=""/>
    <image title="" source="components/store/images/DSC_0010.jpg"  description=""/>
    <image title="" source="components/store/images/DSC_0011.jpg"  description=""/>
    <image title="" source="components/store/images/DSC_0012.jpg"  description=""/>
    <image title="" source="components/store/images/DSC_0015.jpg"  description=""/>
    <image title="" source="components/store/images/DSC_0016.jpg"  description=""/>
    <image title="" source="components/store/images/DSC_0024.jpg"  description=""/>
    <image title="" source="components/store/images/DSC_0026.jpg"  description=""/>
    <image title="" source="components/store/images/DSC_0028.jpg"  description=""/>
    <image title="" source="components/store/images/DSC_0030.jpg"  description=""/>
    <image title="" source="components/store/images/DSC_0033.jpg"  description=""/>
    <image title="" source="components/store/images/DSC_0034.jpg"  description=""/>
    </images>
    </root>

  • Actionscript question-triggering MC event with other MC

    hello, i have a flash file of a scene. part of scene shows a lake. in the water is a faint outline of a fish swimming back and forth, sort of ghosted in the water. i want to click on it and have a fish jump out of the water. the ghosted fish and the jumping fish are 2 separate movie clips that have been independently animated. when I combine them into the scene using actionscript to trigger the jump, it doesn't work. very new to AS but i've learned enough to understand that the script should have an if/then command or a function saying that when mouse is rolled over and clicked the jump takes place. does the ghosted fish and jumping fish have to be in the same movie clip on separate layers? if they can be separate movie clips i would prefer that. what is the basis of the script that tells flash that when I click the ghosted fish it will trigger the jump? attached here is a link to my swf. it shows the animation of the 2 MC's independent of each other for discussion purposes. also deer is a button.
    just thought of other question. can a shape tween work with symbols? I have a cloud art that I want to tween into a thunderhead created in Illustrator and imported that I would like to shape tween but isn't working. do shape tweens only work with flash generated artwork?
    www.coroflot.com/public/individual_file.asp?from_url=true&individual_id=183107&portfolio_i d=2601533&is_featured=%2D1& 
    thanks!!

    Whats an easy way to rename files in MC?
    Pressing F6 fills the path to directory in opposing pane. I would like it to fill the selected file name instead, so I could change a few letters
    But of course default behaviour is required more often...
    Is it possible to make a customized F2 user menu entry that would only rename files?

  • Does XML Actionscript Work in Air?   & More!

    Hi,
    I've tinkered around with Flash and Director a bit, but am totally new to authoring for Air!
    I'm looking to create a dual screen application that displays something like a DVD menu on a touch screen, then plays HD .flv files on the other.  The other screen likely being a 47" LCD screen or something.
    What I'd like to know is, will Air allow me to use XML function actionscript to call up "on-the-fly" subtitles for the .flv movies that are called up?
    Also, for dual-display movies, does the resolution have to match?
    Thanks in advance!

    Thanks Chris!
    Made my day a lot easier
    // Erik

  • Xml pdf questions

    Trying to create a pdf from xml using asp<br /><br />I created the following code.  The form appears without the field being populated.  I went into designer pull up the pdf added some data and tried<br />to export the data as xml and xdp.  The xml shows with no data. Trie to open xdp its say unable to locate template.<br /><br />Is this xml correct?  (this is being used in designer to perform the <br />binding<br /><?xml version="1.0" encoding="UTF-8"?><br /><TextField1><value>Howard</value></TextField1><br /><br />After I have binded the field<br /><br />I use the following asp to display the pdf with<br />the one field filled in.<br /><br />Is this xml correct?<br /><br /><%<br />Response.ContentType = "application/vnd.adobe.xdp+xml"<br />response.write   "<?xml version='1.0' encoding='UTF-8'?>"<br />response.write  "<?xfa generator='AdobeDesigner_V7.0' APIVersion='2.2.4333.0'?>"<br />response.write  "<xdp:xdp xmlns:xdp='http://ns.adobe.com/xdp/'>"<br />response.write  "<xfa:datasets xmlns:xfa='http://www.xfa.org/schema/xfa-data/1.0/'>"<br />response.write  "<xfa:data xfa:dataNode='dataGroup'>" <br />response.write  "<form><TextField1><value><text>Howard</text></value></TextField1></form>"<br />response.write  "</xfa:data>" <br />response.write  "</xfa:datasets>"<br />response.write  "<pdf href='http://159.83.96.138/prod/myFirstShot.pdf' xmlns='http://ns.adobe.com/xdp/pdf/' />"<br />response.write  "<xfdf xmlns='http://ns.adobe.com/xfdf/' xml:space='preserve'>" <br />response.write  "<annots/>" <br />response.write  "</xfdf>" <br />response.write  "</xdp:xdp>" <br />Response.Flush <br />Response.End <br />             <br />%>

    I can't answer directly, but when discussing a specialized tool, you might also read/ask here
    Acrobat SDK Developer Forum http://forums.adobe.com/community/acrobat/acrobat_sdk
    It may be that a developer can answer your questions about "why"

  • An XML design question.

    I have read the tomcat-users.xml file.
    <?xml version='1.0' encoding='utf-8'?>
    <tomcat-users>
      <role rolename="tomcat"/>
      <role rolename="role1"/>
      <role rolename="manager"/>
      <role rolename="admin"/>
      <user username="tomcat" password="tomcat" roles="tomcat"/>
      <user username="both" password="tomcat" roles="tomcat,role1"/>
      <user username="role1" password="tomcat" roles="role1"/>
      <user username="admin" password="admin" roles="admin,manager"/>
    </tomcat-users>There are some question about the disign of the xml.
    1.Why the xml file don't have a DTD, I think that the username,rolename should be an "ID" so as to be identical?So i think it should have a DTD to constrain them.
    2.Why the "rolename","username","password" are designed as attributes,not as element children? Which is better if i design them as element children?

    1. DTDs are not necessay for XML files. If a small and easy-to-understand XML file like this one is created, it doesn't really need a DTD to go with it. You could write a DTD to go with this file. It will look like this:
    <!---- A DTD for the tomcat-users XML File --->
    <!ELEMENT tomcat-users (role+, user+)>
    <!ELEMENT role EMPTY>
    <!ATTLIST role
    rolename (tomcat | role1 | manager | admin) #REQUIRED>
    <!ELEMENT user EMPTY>
    <!ATTLIST user
    username (tomacat | both | role1 | admin) #REQUIRED
    password (tomcat | admin) #REQUIRED
    roles CDATA #REQUIRED>
    You would have to add a tag in the XML file to reference such a DTD.
    I disagree that rolename and username should be merged. How would you explain the function of the username "Both"? You need to have the username belong to a separate element than the role to reference it in some attribute ( in this case, the "roles" attribute of the "user" element ).
    2. I have began answering part 2 in the first part. It would be useless to have "rolename", "username" and "password" as children element. First, that would mean that the elements "role" and "user" wouldn't have any meaning anymore, they would only be top elements sitting and doing nothing. Second, the way the document is written suggests that although the role and the user are closely related, they should be separated to define roles independently of what users are assigned.
    Hope that was helpful, please let me know if you have further questions.

  • XML newbie question

    Hi,
    Firstly, I am sorry to post native-XML question here..
    I am using XML in my Java application and came across XML Schema.
    As far as I know XML Schema does similar job(validating xml doc) with DTD with more functions.
    Is that all XML Schema can do, validating related XML doc?
    My application needs to build different types of XML docs with existing XML Schemas.
    This is silly question but...
    Is there any way to embed XML Schema into XML builder/parser so that it can be used to generate XML doc ?
    In other words, when building XML doc, is it possible to guilde the building process with XML Schema...
    If not, then building different XML docs with different XML Schemas in my application would be very tedious...
    Thanks in advance.

    To generate an XML document from an XML schema, generate java classes from the Schema with JAXB.
    Construct an XML document from the java classes by marshalling a java object.

  • XML & Actionscript 3

    I am having a hard time making the transition in my mind to
    using xml in Actionscript 3. I was wondering if someone could look
    at my AS and help me write comparible AS3 code to further my
    understanding of dealing with xml in AS3. I am using the flash 9
    preview app.

    I've found that dealing with white space when using external content stored in XML files can be a little tricky, so I wrote this blog post about the issue http://flexdiary.blogspot.com/2013/05/actionscript-e4x-and-white-space.html .

Maybe you are looking for

  • Read data from a .csv located on another server

    Hi!: I've an application that currently reads some data from a .CSV file that I upload everyday using a file browser item plus a custom procedure to parse it. I was wondering if it'd be possible to automatically read the information from a remote fil

  • Transparent windows - bug?

    HI Everyone, today my imac at work did something quite extravagant - not sure if it's a bug or not? (I'd actually like to replicate this at will) basically, while swapping back and forth through windows, everything became transparent but for chrome (

  • How to send contact via bluetooth?

    I just purchased a vehicle that has handsfree bluetooth capbility to use my iPhone. I got the thing to call but my question is, how do I transfer my contacts from my iPhone to my car?

  • LS 2013: Error with User/Role Screen

    I upgraded my LightSwitch application from VS 2012 to VS 2013 (VS 2013 Update 1). Now, when I access the user/roles screen, I receive the following error now: Could not load file or assembly 'Microsoft.Data.Services, Version=5.3.0.0, Culture=neutral,

  • Creating actions to save files

    Hello all, I want to have an action that takes the input file and creates a JPEG for web and places it in the same folder that the input file is located.  Is this possible? Normally, when creating an action to Save for Web, it will save the file in a