From: Nick201 on
I am trying to put hx:name and i am getting error message any idea? I think
when I use : (colan) that consider as expression

<addresses>
<address>
<hx:name>Richard Mutt</hx:name>
<addrLine1>30 Main St.</addrLine1>
<addrLine2>New Haven, CT 06460</addrLine2>
</address>
</addresses>

<cfoutput>#resultsXML.address.hx:name.inner_text#</cfoutput>

Any help would be appreciated. Thanks

From: BKBK on
When you use a prefix like hx, the XML processor expects you to declare a http://www.w3.org/TR/REC-xml-names/#NT-PrefixedName.


From: Nick201 on
Thanks. You mean declare in xml file right or when you out put this?? I am not sure where to declare.


From: BKBK on
<cfxml variable="resultsXML">
<addresses>
<address>
<hx:name xmlns:hx='http://www.google.com'>Richard Mutt</hx:name>
<addrLine1>30 Main St.</addrLine1>
<addrLine2>New Haven, CT 06460</addrLine2>
</address>
</addresses>
</cfxml>

<cfoutput>#resultsXML.addresses.address["hx:name"].xmltext#</cfoutput>


Three things:
1) Use namespace
(Here I use google arbitrarily)
2) Use associative array notation to avoid problems with the colon
3) I have corrected the output variable



From: Nick201 on
Thanks. I have similar question

<StandardReports xmlns="http://ns.aaa.org/report/s1/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:lom="http://labc.org/xsd/doc" xmlns:m="http://ns.abq.org/student/k1/"
xmlns:n="http://ns.cq.org/name/k1/" xmlns:hx="http://ns.medbiq.org/extend/k1/"
xsi:schemaLocation="http://ns.qqq.org/report/s1/at.xsd">

How do I validate this xsd files.

I did this
<cfset
myResults=XMLValidate("example.xml","http://ns.qqq.org/report/s1/at.xsd")>

I am getting following error


struct
errors
array
1 [Error] :2:412: cvc-elt.1: Cannot find the declaration of element
'StandardReports'.
fatalerrors
array [empty]
status NO
warnings
array
1 [Warning] :2:412: SchemaLocation: schemaLocation value =
'http://ns.qqq.org/report/s1/at.xsd' must have even number of URI's.