You can do both really. The XMLXQueryExtractor is a little bit more elegant if you just need to extract one tag, but can be a bit trickier to set up.
You can do both really. The XMLXQueryExtractor is a little bit more elegant if you just need to extract one tag, but can be a bit trickier to set up.
Thank you for the response. Should I re-use one of the XML Transformers there or is it better to add a new one?
I'm worried about using the XML Fragmenter because I don't see a specific way to get the value of the exact tag I need and there are many tags with the same name all over but only 1 in that particular hierarchy.
Can I add to the current XMLXQuery Transformer?
The path to the exact element I want is <SearchCourseSectionProfileResult><courseSectionProfiles><courseSectionProfile><code>
Or I guess using XPath syntax = /SearchCourseSectionProfileResult/courseSectionProfiles/courseSectionProfile/code
How do I change that into FME Xquery?
can I just add :
let $code := /SearchCourseSectionProfileResult/courseSectionProfiles/courseSectionProfile/code
return data($code)
Will that work?
Currently the XMLQueryExtractor is doing this >
let $TuitionProfileObjId :=
for $n in //*:SearchCourseSectionProfileResult/*:courseSectionProfiles/*:courseSectionProfile/*:courseSectionFees/*:courseSectionFee/*:associatedSectionFeeTuitionProfiles/*:associatedSectionFeeTuitionProfile/*:associatedTuitionProfile
where $n/*:description/text() = {fme:get-attribute("ROLE")}
return data($n/*:objectId)
return ($TuitionProfileObjId)
Thank you for the help. Much appreciated
Thank you for the response. Should I re-use one of the XML Transformers there or is it better to add a new one?
I'm worried about using the XML Fragmenter because I don't see a specific way to get the value of the exact tag I need and there are many tags with the same name all over but only 1 in that particular hierarchy.
Can I add to the current XMLXQuery Transformer?
The path to the exact element I want is <SearchCourseSectionProfileResult><courseSectionProfiles><courseSectionProfile><code>
Or I guess using XPath syntax = /SearchCourseSectionProfileResult/courseSectionProfiles/courseSectionProfile/code
How do I change that into FME Xquery?
can I just add :
let $code := /SearchCourseSectionProfileResult/courseSectionProfiles/courseSectionProfile/code
return data($code)
Will that work?
Currently the XMLQueryExtractor is doing this >
let $TuitionProfileObjId :=
for $n in //*:SearchCourseSectionProfileResult/*:courseSectionProfiles/*:courseSectionProfile/*:courseSectionFees/*:courseSectionFee/*:associatedSectionFeeTuitionProfiles/*:associatedSectionFeeTuitionProfile/*:associatedTuitionProfile
where $n/*:description/text() = {fme:get-attribute("ROLE")}
return data($n/*:objectId)
return ($TuitionProfileObjId)
Thank you for the help. Much appreciated
You can use the Elements to match parameter in the XMLFragmenter to read specific elements.
Other than that, my best advice is to give it a try. For me, working with XML (and JSON to a lesser degree) often comes down to a process of trial and error. And that's fine, you build up valuable experience that way. Besides, as long as you're not writing to a live/production dataset until you know you're really done with the workspace there's not a whole lot that can go wrong.