Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default XML / XSLT / CF

    Hi Everyone,

    I'm trying to parse my XML File with ColdFusion and I've already made an
    Object like:

    <cffile action="read" file="C:\myxmldoc.xml" variable="XMLFileText">
    <cfset myXMLDocument=XmlParse(XMLFileText)>
    <cfoutput>#toString(myXMLDocument)#</cfoutput>

    my Problem is: I only want to output some childs not the whole XML-File.
    I could tranform it with XSLT, but my <xsl:template>...</xslt:template> as xls
    String doesn't work.

    Thx 4 help,
    Sonix

    [lb]Sonix Guest

  2. Similar Questions and Discussions

    1. XSLT and XML editing with DW8
      Hello, I have to edit an server side xslt fragment and I would like to use Dreamweaver to do so. The problem is that the XSLT and XML is...
    2. XSLT url variable
      I have the following XML page generated by ColdFusion <article id=1> <author>Joe Mac</author> <title>Syndicate goes on strike</title> <body>...
    3. rebuild php-4.2.2-17.2 with "--with-xml --enable-xslt --with xslt-sablot" on RedHat 9.0
      Hi, I have RedHat 9.0 and installed by default Apache+PHP. By default XSLT Sablotron support is not enabled, so how can I rebuild PHP with xslt...
    4. XML::XSLT Module without LWP
      I'm trying to use the XML::XSLT to do a transformation on an XML using XSLT file, both of which are on my server. XML::XSLT uses LWP as far as I...
    5. XML::XSLT
      Hello everybody, Could anyone help me .... I am using module XML::XSLT to transform a file .xml with a stylesheet .xls. I think that is...
  3. #2

    Default Re: XML / XSLT / CF

    I'm going to use the latest virus alerts feed from .link.XmlText# (where x is
    the item number you want)

    From here, you can create a simple loop that changes the value of X and
    outputs all the items. Even if you're only retrieving one node of data (and
    not a series), hopefully the steps described above should help you determine
    how to locate and reference the nodes you need.






    <!--- // Retrieve XML file for latest virus alerts // --->
    <cfhttp url="http://www.sophos.com/virusinfo/infofeed/tenalerts.xml"
    method="GET"
    timeout="15">
    </cfhttp>

    <!--- // Trim whitespace and parse XML // --->
    <cfscript>
    XMLContent = trim(cfhttp.filecontent);
    XMLContent = XMLParse(XMLContent);
    </cfscript>

    <!--- // Output ONLY THE FIRST 5 alerts // --->
    <cfoutput>
    <cfloop from ="1" to="5" index="i">
    <a href="#XMLContent.RDF.item[i].link.XmlText#"
    target="_blank">#XMLContent.RDF.item[i].title.XmlText#</a><br>
    </cfloop>
    </cfoutput>

    RoBsTaMaCk Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139