Maybe I should clarify.

When I fetch the XML file with
<cfhttp    url="http://www.somewebsite.com/rss/someRss.xml";    method="get">

the resulting CFHTTP.FileContent variables contains the following lines

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="news_rss.xsl"?>

I need some code to parse / remove the above lines from the chttp.fileconent 
variable.  Once I have removed the above lines the XML would then be well 
formed.




---------- Original Message ----------------------------------
From: "Kris Jones" <[EMAIL PROTECTED]>
Reply-To: [email protected]
Date:  Wed, 18 Apr 2007 14:46:29 -0400

>
>Sounds kind of obvious, but is the document someRss.xml well-formed?
>It must have a single root element to be valid.
>
>This block is invalid because there is no single root element:
>----------------------------
><record>
>       <column>some value A</column>
>       <column>some value B</column>
></record>
><record>
>       <column>some value C</column>
>       <column>some value D</column>
>       <column>some value E</column>
></record>
>-------------------------------
>This block is valid because there is a single enclosing root element:
>-------------------------------
><data>
>       <record>
>               <column>some value A</column>
>               <column>some value B</column>
>       </record>
>       <record>
>               <column>some value C</column>
>               <column>some value D</column>
>               <column>some value E</column>
>       </record>
></data>
>-------------------------------
>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <?xml-stylesheet type="text/xsl" href="news_rss.xsl"?>
>>
>> The above code is at the top of an XML feed that I am trying to process. I 
>> want to remove it, otherwise I get the following error.
>>
>> Document root element is missing.
>> Document root element is missing.
>>
>> My code looks like this.
>> <cfhttp    url="http://www.somewebsite.com/rss/someRss.xml";    method="get">
>> <cfset myXMLDoc=XMLParse(CFHTTP.FileContent)>
>>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275751
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to