Le 31/05/2015 23:39, Samuel Gougeon a écrit :
Hello,

I am trying to get the list of _names_ of attributes of an XML tag. Getting their values is OK, but i fail catching related names!
Is this possible?

Yes! I finally got them:
s  =  "<root xmlns:bar=""http://www.scilab.org/"";>"+..
     "<bar:a att=""foo"" rib=""bar"">"+..
     "<b>Hello</b><c> world</c></bar:a></root>"
doc  =  xmlReadStr  <xmlReadStr.html>(s);
Then:
*a= xmlXPath**(**doc.root.children(1)**,**  **"@*"**)*
and finally:

-->*a.name*
 ans  =

!att  rib  !


as well as

-->*a.content*
 ans  =

!foo  bar  !
.
I would have expected that .name and .content be usable on e, but previous trials showed that it is/was not the case
.
-->e = doc.root.children(1).attributes
 e  =

XML Attributes
att --> foo
rib --> bar

-->e.name
 ans  =
     []

-->e.content
 ans  =
     []
It would be quite intuitive and more straightforward.

Samuel

_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to