<cfscript>
selectedElements = XmlSearch(XmlParse(trim(cfhttp.fileContent)), "/abc/
xyz/");
for (i = 1; i LTE ArrayLen(selectedElements); i = i + 1)
IUseAnArrayForThisYouCanUseWhatYouWant[i][2] =
selectedElements[i].normal.name.space.XmlText;
for (i = 1; i LTE ArrayLen(selectedElements); i = i + 1)
IUseAnArrayForThisYouCanUseWhatYouWant[i][3] = selectedElements[i]
["saml:name"].XmlText;
</cfscript>
Note the lack of a period (.) between the two bracketed items .... [i]
["saml:name"] whereas in the first instance, there is a period between
the elements ...[i].normal.name.space.XmlText;
Colons (:) should NOT be in a name space. Yet, I have two feeds that I
have to parse with it. Thanks to this list, I found a way around it.
But... jack asses will be jack asses.
Problem comes down to 1) how you read the specs and 2) if you decide
to be Atom compliant, XML compliant, XSL, RSS 1.0, 2.0, yadda yadda.
Bunch of krap. People forming XML documents for others to digest
should just stop being so difficult and make an easy to parse name.
Hell, underscores are OK, so why not use those?
That being said, I am sure I will get 10, no 20, no 100 replies on the
list telling me how wrong I am. But that doesn't change the fact that
an XML author who is considerate of others can avoid these issues.
http://www.stylusstudio.com/xmldev/200503/post90310.html#
By XML 1.0[1] technically yes, but the second note in section 2.3 after
production [3] states: The Namespaces in XML Recommendation [XML Names]
assigns a meaning to names containing colon characters. Therefore,
authors
should not use the colon in XML names except for namespace purposes, but
XML processors must accept the colon as a name character.
This coming from a person who codes XHTML 1.0 strict. So, take it for
what it's worth.
_____________
Derrick Peavy
404-786-5036
Sales and Web Services
CollegeClassifieds.com
http://www.collegeclassifieds.com
A Service of Universal Advertising, inc.
___________________________________
On Aug 25, 2008, at 5:07 PM, Douglas Knudsen wrote:
sounds like fun with namespaces. You might be able to use a
wildcard, depends on your use case there.
Here is a example
http://www.aftergeek.com/2006/08/xmlsearch-xpath-and-xml-namespaces-in.html
DK
On Mon, Aug 25, 2008 at 4:51 PM, Ajas Mohammed <[EMAIL PROTECTED]>
wrote:
Hi,
I have a working example of moving elements in an xml. I got it from
web. It works fine for an xml file like this. see code attached.
MovingXMLElement_test[1].cfm (application/x-cfm) 54K works
MovingXMLElement.cfm (application/x-cfm) 7K does not work and I get
this error
Invalid CFML construct found on line 46 at column 19.
ColdFusion was looking at the following text:
:
The CFML compiler was processing:
* a cfset tag beginning on line 46, column 2.
The issue is that the xml I am working with has name prefix like this
<samlp:employee>
<saml:name>xyz</saml:name>
</samlp:employee>
Any suggestions? Please dont mind the indentation of xml file, in
the code which is not working.
--
<Ajas Mohammed />
http://ajashadi.blogspot.com
We cannot become what we need to be, remaining what we are.
No matter what, find a way. Because thats what winners do.
You can't improve what you don't measure.
Quality is never an accident; it is always the result of high
intention, sincere effort, intelligent direction and skillful
execution; it represents the wise choice of many alternatives.
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink
-------------------------------------------------------------
--
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink
-------------------------------------------------------------