ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* XML attributes
@ 2001-10-13 21:08 Simon Pepping
  2001-10-15  7:56 ` Hans Hagen
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Pepping @ 2001-10-13 21:08 UTC (permalink / raw)


I have been experimenting a bit with attributes, e.g. in this phrase:
<item>And even worse<ref/>, <ref name="att"/> attributes <ref/> will not be the
same as in &context;.</item>

1. In the third ref element, the value \XMLpar{ref}{name}{\relax} is
   not relax. Because the element has no (rather an implicit)
   attribute name, the context value is left as it was set by the
   preceding ref element. I think it would be better if attribute
   values are local to the element, and there exists a command that
   lets the user store the value in a control sequence, much like
   \defXMLstring\command.

2. When I use the attribute like this:
   \doifXMLparelse{ref}{name}{(ref:\XMLpar{ref}{name}{})}{}, it would
   be nice to have a shorter way to access the attribute value, say
   \XMLattvalue. The above code contains two implicit if/then branches
   for the attribute, the second not very useful.

Regards, Simon

-- 
Simon Pepping
email: spepping@scaprea.hobby.nl


^ permalink raw reply	[flat|nested] 13+ messages in thread
* XML attributes
@ 2002-07-09  9:47 scarsoluigi
  2002-07-09 19:05 ` Simon Pepping
  0 siblings, 1 reply; 13+ messages in thread
From: scarsoluigi @ 2002-07-09  9:47 UTC (permalink / raw)


Hi, i'm just working on xml and context and i have the following
question:
give the following doc. fragm.

<node type="type1">
  <node type="type2">
    <leaf>LEAF</leaf>
  </node>
  <node >FLAT</node>
</node>

How can i discriminate <node> by attribute, and how to recognize <node>
without attribute?
Thanks
luigi


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: XML attributes
@ 2002-07-10  6:51 scarsoluigi
  2002-07-10 20:05 ` Simon Pepping
  0 siblings, 1 reply; 13+ messages in thread
From: scarsoluigi @ 2002-07-10  6:51 UTC (permalink / raw)


> \edef\tmp{\XMLpar{node}{type}{}
> \doifelse{\tmp}{type1}{case for type1}
>       {\doifelse{\tmp}{type2}{case for type2}
>               {case for other values}}}
> 
> or
> 
> \processaction[\XMLpar{node}{type}{default}]
>       [  type1=>case for type1,
>          type2=>case for type2,
>        default=>default case]
> 
many thanks simon, I will work on it today.
So, another question (yes,  I have texbook but i'm a novice):

give
<node attr="<context command or enviroinment">
...
</node>

where <context command or enviroinment> is for example
 {\bf} 
or 
 \startframedtexts[...setups..] ... \stopframedtexts

how can i 'execute'  under context the attr value ?

thanks
luigi


^ permalink raw reply	[flat|nested] 13+ messages in thread
* XML attributes
@ 2003-06-05 22:06 Jedrzej Nasiadek
  2003-06-06 19:37 ` Simon Pepping
  0 siblings, 1 reply; 13+ messages in thread
From: Jedrzej Nasiadek @ 2003-06-05 22:06 UTC (permalink / raw)



Hi,

So I've got to use this modern XML thingy.. ;-)
I tried to set up ConTeXt to typeset processed XML data.
What goes wrong is the \XMLpar which sometimes gives default value
instead of the real one. See the code below:

\starttext
\defineXMLpickup [log]
   {\starttabulate[|p(7cm)|p|] \HL\NC ObjectID \NC Value \NC\NR\HL}
   {\stoptabulate}

\defineXMLenvironment [var]
    {\NC \XMLpar{var}{name}{blah} \NC }
    {\NC\NR }

\startXMLdata
<log>
<entry date="1054844187">
<var name=".1.3.6.1.2.1.5.16.0"> 28674524 </var>
</entry>
<entry date="1054844247">
<var name=".1.3.6.1.2.1.5.16.0"> 28674677 </var>
</entry>
<entry date="1054844307">
<var name=".1.3.6.1.2.1.5.16.0"> 28674824 </var>
</entry>
<entry date="1054844367">
<var name=".1.3.6.1.2.1.5.16.0"> 28674963 </var>
</entry>
</log>
\stopXMLdata

\stoptext


If I remove the \NC before \XMLpar -- it gives the real value of the
name attribute. 

  Jedrzej

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2003-06-13 16:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-13 21:08 XML attributes Simon Pepping
2001-10-15  7:56 ` Hans Hagen
2001-10-15 18:50   ` Simon Pepping
2002-07-09  9:47 scarsoluigi
2002-07-09 19:05 ` Simon Pepping
2002-07-10  6:51 scarsoluigi
2002-07-10 20:05 ` Simon Pepping
2002-07-12 16:31   ` Hans Hagen
2003-06-05 22:06 Jedrzej Nasiadek
2003-06-06 19:37 ` Simon Pepping
2003-06-06 20:55   ` Jedrzej Nasiadek
2003-06-13 16:18     ` Hans Hagen
2003-06-07  0:03   ` Jedrzej Nasiadek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).