• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFXML and Namespace References Order

Guest
May 05, 2011 May 05, 2011

Copy link to clipboard

Copied

I am using cfxml top create an xml file to send to a third party.
There are two Namespace references in the xml.  The problem is that cfxml apparently alphabetizes the reference order.  This results in a "fatal xml error" from the third party I am submitting the xml to.
It's a guess as to the alphabetizing, but CF is definitely switching the references in the resulting xml.

This is what's in my code:
<CFXML variable="MyXML">
<?xml version="1.0"?>
...
...

When I view the resulting xml the namespace reference have switched:
...
...

Anyone know of a way to get CF to do what I tell it?

TOPICS
Advanced techniques

Views

999

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , May 05, 2011 May 05, 2011

robs67 wrote:


Anyone know of a way to get CF to do what I tell it?


IF you are not using the XML data structure in ColdFusion, and I presume you are just passing an XML string, then just create the XML string directly.

Basically, if you replace the <cfxml....> with <cfsavecontent...> you can get just that.  Just know that with the <cfsavecontent...> version, you are responsible for you own XML prologue.

Votes

Translate

Translate
Valorous Hero ,
May 05, 2011 May 05, 2011

Copy link to clipboard

Copied

robs67 wrote:


Anyone know of a way to get CF to do what I tell it?


IF you are not using the XML data structure in ColdFusion, and I presume you are just passing an XML string, then just create the XML string directly.

Basically, if you replace the <cfxml....> with <cfsavecontent...> you can get just that.  Just know that with the <cfsavecontent...> version, you are responsible for you own XML prologue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 05, 2011 May 05, 2011

Copy link to clipboard

Copied

Thank you so much.  That worked just fine.

I'm curious though.  Is it normal for an XML parser to put the namespace references in alpha order?  Or is that just a CF thing?

Thanks again!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
May 05, 2011 May 05, 2011

Copy link to clipboard

Copied

robs67 wrote:

Is it normal for an XML parser to put the namespace references in alpha order?  Or is that just a CF thing?

I don't know for sure, I have never had to dig that deep into ColdFusion's XML features.

I can speculate that the XML Object in memory does not have any 'order' to the namespace references (or any other of the references that make up the XML data object).  It is not until that internal object is output as a string representation that the ordering occurs.

It is also a bit of an open question in my mind of why any XML parser should care about the order of elements.  It's sort of a basic premise of XML that order should seldom matter, is it not?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 05, 2011 May 05, 2011

Copy link to clipboard

Copied

I absolutely agree that the parser should not care about the order.  It took me two days to figure out that was the reason it was returning a "fatal xml" error.

The only answer I can give is the third party I referenced, hence the operator of that wonderful parser, is a US government agency.  Perhaps not a good answer, but explains much nonetheless (I hope).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
May 05, 2011 May 05, 2011

Copy link to clipboard

Copied

robs67 wrote:

the operator of that wonderful parser, is a US government agency.

SO is the provider of the assistance you have received today!

Be carefull of those broad brushes in your paint can!

ILSSAC: Worker at a State Government agency.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2011 May 05, 2011

Copy link to clipboard

Copied

The government giveth, and the government taketh away.

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 05, 2011 May 05, 2011

Copy link to clipboard

Copied

LATEST

Oh, I just KNEW you were going to say that Ilssa! 

This a a Federal agency.  A very, very frustrating Federal agency. Perhaps why my paint can has broad brushes.  The color of the paint is "Frustrating Fuchsia".

Sorry about that.  Certainly didn't mean to offend.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
May 05, 2011 May 05, 2011

Copy link to clipboard

Copied

Message was edited by: ilssac to remove the duplicate post.  One just gotta love this Jive forum doesn't one.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation