[NTG-context] Question about parsing XML and attributes (normally var.at.attrib) with a name with ':' in it

Taco Hoekwater taco at bittext.nl
Sun Feb 14 23:31:50 CET 2021


Hi Gerben,

Not behind a computer right now, but you should look at the output of 

   table.print(foo)

Best wishes,
Taco

> On 14 Feb 2021, at 23:12, Gerben Wierda <gerben.wierda at rna.nl> wrote:
> 
> 
> foo.at[“attribute:B”]
> 
> I looked at the code and guessed this. Still haven’t found really good documentation for lua, lua in ConTeXt, and especially theXML stuff (it’s all written as \xmlsomething TeX commands. No idea if this is ConTeXt, lua or whatever but it works.
> 
> Gerben Wierda (LinkedIn)
> R&A Enterprise Architecture (main site)
> Book: Chess and the Art of Enterprise Architecture
> Book: Mastering ArchiMate
> 
>> On 14 Feb 2021, at 22:40, Gerben Wierda <gerben.wierda at rna.nl> wrote:
>> 
>> If I have an XML element like this:
>> 
>> <A x=“one” attribute:B=“two"/>
>> 
>> and it has been read in a lua variable foo, I can get at attribute x with foo.at.x 
>> 
>> But how do I get at attribute:B?
>> 
>> Gerben Wierda (LinkedIn)
>> R&A Enterprise Architecture (main site)
>> Book: Chess and the Art of Enterprise Architecture
>> Book: Mastering ArchiMate
>> 
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry to the Wiki!
>> 
>> maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki     : http://contextgarden.net
>> ___________________________________________________________________________________
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20210214/dff5f64f/attachment.htm>


More information about the ntg-context mailing list