Helped very much, thanks.
Here's what I've ended up with, for feedback, and for reference if
anyone else needs to do the same thing:
<!--- find path to bluedragon.xml file --->
<cffile action="READ" file="#ExpandPath('/WEB-INF/web.xml')#"
variable="fileText">
<cfset xmlDoc = XmlParse(fileText)>
<cfset xmlNodes = XmlSearch(xmlDoc, "//*[.='BLUEDRAGON_XML']/following-
sibling::*/")>
<!--- parse bluedragon.xml, get datasources --->
<cffile action="READ" file="#ExpandPath(xmlNodes[1].XmlText)#"
variable="fileText">
<cfset xmlDoc = XmlParse(fileText)>
<cfset xmlNodes = XmlSearch(xmlDoc, "//*[name()='datasource']")>
<!--- build names and displayNames lists --->
<cfloop from="1" to="#ArrayLen(xmlNodes)#" index="i">
<cfset sqlDSNNamesList = ListAppend(sqlDSNNamesList, xmlNodes
[i].name.XmlText)>
<cfset sqlDSNDisplayNamesList = ListAppend(sqlDSNDisplayNamesList,
"#xmlNodes[i].name.XmlText# (#ListLast(xmlNodes[i].drivername.XmlText,
".")#)")>
</cfloop>
Thanks again for all your help,
e
On Aug 24, 8:05 pm, Matthew Woodward <[email protected]> wrote:
> Having a schema declaration in the top node throws XML searches off--I'm
> not enough of an xpath guru to know why, but this happens in ColdFusion
> as well.
>
> Just use the local-name() function and it'll resolve the issue, and this
> works whether there's a schema declaration or not:
> <cfset nodes = XmlSearch(xmlDoc, "//*[local-name()='servlet']") />
>
> Hope that helps.
--~--~---------~--~----~------------~-------~--~----~
Open BlueDragon Public Mailing List
http://groups.google.com/group/openbd?hl=en
official site @ http://www.openbluedragon.org/
!! save a network - trim replies before posting !!
-~----------~----~----~----~------~----~------~--~---