On 08/03/16 02:39, Adrien Prokopowicz wrote:
> Le Mon, 29 Feb 2016 15:10:49 +0100, KKing <kicking...@gmail.com> a écrit:
>
>> On 17/02/16 09:15, KKing wrote:
>>> does the XML component support a GetSingleNode method or allow an
>>> XPath to be used to obtain single nodes?
>>>   - - - -
>>>
>> is that a no then?
>>
>>
> At the moment, there is no XPath support for the gb.xml component.
>
> However, if you want to select specific nodes, you have several methods
> at your disposal :
>
> * The XmlElement.GetChildrenByTagName()[0] can be used to search elements
>     with specific tag names, but it also supports LIKE[1] patterns. It can
>     also receive a depth parameter if you want to restrict your search;
> * The XmlElement.GetChildrenByAttributeValue()[2] works with similar
> options;
> * The gb.xml.html sub-component adds a XmlElement.GetChildrenByFilter()[3]
> method,
>     to which you can pass a CSS filter. Not all CSS expressions are
> supported though
>     (see the MatchFilter()[4] help).
>
> Hope that helps,
>
> [0] http://gambaswiki.org/wiki/comp/gb.xml/xmlelement/getchildrenbytagname
> [1] http://gambaswiki.org/wiki/lang/like
> [2]
> http://gambaswiki.org/wiki/comp/gb.xml/xmlelement/getchildrenbyattributevalue
> [3]
> http://gambaswiki.org/wiki/comp/gb.xml.html/xmlelement/getchildrenbyfilter
> [4] http://gambaswiki.org/wiki/comp/gb.xml.html/xmlelement/matchfilter
>
ta, I did contemplate the GetChildren methods.
Due to time pressures, and a very specific need, I resorted to modifying 
the xml file via string manipulation.

If I ever need to revisit I may look to do it better, either within my 
code or extending the component.
Would XPath fit within the gb.xml component, or would you imagine a 
gb.xml.xpath component?



------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to