ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: luigi scarso <luigi.scarso@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: question for the xml-experts
Date: Thu, 19 Feb 2009 15:10:43 +0100	[thread overview]
Message-ID: <fe8d59da0902190610h6f5067ccl9208baf902a228f9@mail.gmail.com> (raw)
In-Reply-To: <0EFC87B1-9EF1-4DF6-A9B7-0A34A7BCCD6F@uni-bonn.de>

On Thu, Feb 19, 2009 at 12:53 PM, Thomas A. Schmitz
<thomas.schmitz@uni-bonn.de> wrote:
>
> On Feb 19, 2009, at 11:39 AM, luigi scarso wrote:
>
>>>>>
>>>>>
>>>>> FOO = etree.Element("FOO")
>>>>> emph =  etree.Element("emph")
>>>>> [child.tag for child in foo.iterdescendants(tag =
>>>>> '{urn:oasis:names:tc:opendocument:xmlns:text:1.0}span' ) ]
>>
>> ['{urn:oasis:names:tc:opendocument:xmlns:text:1.0}span']
>>>>>
>>>>> span = [child for child in foo.iterdescendants(tag =
>>>>> '{urn:oasis:names:tc:opendocument:xmlns:text:1.0}span' ) ][0]
>>>>> emph.text = span.text
>>>>> FOO.append(emph)
>>>>> etree.tostring(FOO)
>>
>> '<FOO><emph>foo</emph></FOO>'
>>>>>
>>
>
> Excuse me for being dense: you mean all namespaces have to be explicitly
> expanded?
see
http://codespeak.net/lxml/tutorial.html#namespaces




-- 
luigi
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2009-02-19 14:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-14 17:40 Thomas A. Schmitz
2009-02-14 18:25 ` Wolfgang Schuster
2009-02-14 18:37   ` Thomas A. Schmitz
2009-02-15  9:39   ` luigi scarso
2009-02-15 17:17     ` Thomas A. Schmitz
2009-02-17 22:07       ` luigi scarso
2009-02-19  8:54         ` Thomas A. Schmitz
2009-02-19  9:24           ` luigi scarso
2009-02-19 10:39           ` luigi scarso
2009-02-19 11:53             ` Thomas A. Schmitz
2009-02-19 14:10               ` luigi scarso [this message]
2009-02-20 15:09                 ` Thomas A. Schmitz
2009-02-20 15:35                   ` luigi scarso
2009-02-19 17:02           ` luigi scarso
2009-02-14 18:31 ` Patrick Gundlach
2009-02-14 19:06   ` Thomas A. Schmitz
2009-02-15 10:14 ` Khaled Hosny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe8d59da0902190610h6f5067ccl9208baf902a228f9@mail.gmail.com \
    --to=luigi.scarso@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).