Frage
XSLT or XML Parse
Hey all
I am getting all munged up no matter what i do. I was able to get XSLT to parse/format my data until i reached the "Section" area of the document, and then i got thrown by XSLT 2.0 seemingly refusing to do a regular expression.
Now i'm trying XMLParse and am absolutely not able to figure out where these data are.
I have 2 problems with XMLParse().
1) i was able to loop on toc_section but things quite simply blow up when i try to loop on toc_subsection. isDefined consistently throws 'must be a syntactically valid variable'. but if the variable doesn't exist i get ["giant name] is not defined in parsed_data" i solved toc_section ID by using try/catch, is there some other way? If not How would you design the try catch to get me the hrefs to the subsection id AND the subsection name. Sample code below:
<cftry>
<cfif len(parsed_data.report.chapter.chapter_content.toc.toc_section .XmlAttributes.id)><a href="###parsed_data.report.chapter.chapter_content.toc.toc_section.XmlAttributes.id#">#parsed_data.report.chapter.chapter_content.toc.toc_section .toc_head#</a>
</cfif>
<cfcatch>
#parsed_data.report.chapter.chapter_content.toc.toc_section.toc_head#
</cfcatch>
</cftry>
<cfloop collection="#parsed_data.report.chapter.chapter_content.toc.toc_section .toc_subsection#" item="y">
</cfloop><!--- --->
</p>
2) even if i get through this part, i'm struck by noticing that the inline tags in the <body> tags (which really only need to become p_tags) are being pulled out of the xml text and presented outside of their context. Can you help with that (the one that's visible just needs to become an href to the figure that follows the first body. SPECIFIC XML BELOW
<Section ID="S_6_1">
<Section_Text>
<Body_Head>6.1 Overview</Body_Head>
<Body>A lighting upgrade is the second stage in the building upgrade process. The staged approach accounts for the interactions among all the energy flows in a building (<SeeFigure FigureID="F_6_1">Figure 6.1</SeeFigure>) and produces a systematic method for planning upgrades that maximize energy savings. When the staged approach is performed sequentially, each stage includes changes that will affect the upgrades performed in subsequent stages, thus setting the overall process up for the greatest energy and cost savings possible. In the staged approach to building upgrades, lighting upgrades come early in the process because the lighting system has a significant impact on other building systems, affecting heating and cooling loads and power quality.</Body>
<Figure FigureID="F_6_1">
<filename>EPA-BUM-Lighting_6-1.gif</filename>
<Figure_Title>Figure 6.1: The staged approach to building upgrades</Figure_Title>
<Figure_Caption>The staged approach to building upgrades accounts for the interactions among all the energy flows in a building. Each stage includes changes that will affect the upgrades performed in subsequent stages, thus setting the overall process up for the greatest energy and cost savings possible. Lighting upgrades come early in the process, because the lighting system affects heating and cooling loads and power quality.</Figure_Caption>
</Figure> ...
If anybody can make recommendations, i'd really appreciate it.
I'm unable to post images, i think....so am including a link to the
parsed xml image
I'm happy to read documents about how best to do this, but all i am finding is one level deep (in it's loops) or is taken from the multi level and put into the single level...
