← Prev in month ← Prev in thread
Next in thread → Next in month →

AW: [docbook-apps] Exclude elements witout condition-attribute when profiling

From
Daniela Dänzer <>
Date
2005-03-10T11:29:16+00:00
ID
Thread
AW: [docbook-apps] Exclude elements witout condition-attribute when profiling
Hello Jirka,

Thanks a lot for your prompt reply!

Perhaps I did not make myself very clear.

I have the following:

<chapter>
<title condition="map_dok">xxx</title>
<para condition="map_dok">xxx</para>
<para>x</para>
<sect1>y</sect1>
</chapter>

And I am searching for a way to get only the two elements <title condition="map_dok">xxx</title> and <para condition="map_dok">xxx</para> in my profiled document and not the others. But when I do  "condition=map_dok" I get all of the elements and not only those whose condition-attribute is set.

Is there a way to do this?

Regards,
Daniela

-----Ursprüngliche Nachricht-----
Von: Jirka Kosek [mailto:] 
Gesendet: Donnerstag, 10. März 2005 12:17
An: Daniela Dänzer
Cc: 
Betreff: Re: [docbook-apps] Exclude elements witout condition-attribute when profiling


Daniela Dänzer wrote:

> I want to profile my xml and take all elements where the attribute 
> condition is set to map_dok but not those, who don't have an attribute 
> "condition". How do I do this?
>  
> I tried with  "condition=map_dok;not('')", 
> "condition=map_dok;not(null)" and "condition=map_dok", but no success 
> so far. The elements which don't have the attribute "condition" are always selected.
>  
> How do I exclude these from my profiled document?

Are you *really* sure that you want to do this? This will mean that each 
element that should go to the output must be labeled by profiling 
attribute. E.g.

<section condition="map_dok">
   <title condition="map_dok">...</title>

   <para condition="map_dok">...<emphasis 
condition="map_dok">...</emphasis>...</para>

   ...
</section>

If you really want to go this way, just add the following template into 
your customization layer:

<xsl:template match="*[not(@condition)]" mode="profile"/>

But you have been warned that most documents will be drastically pruned 
this way.				

-- 
------------------------------------------------------------------
   Jirka Kosek     e-mail:      http://www.kosek.cz
------------------------------------------------------------------
   Profesionální školení a poradenství v oblasti technologií XML.
      Podívejte se na náš nově spuštěný web http://DocBook.cz
        Podrobný přehled školení http://xmlguru.cz/skoleni/
------------------------------------------------------------------
← Prev in month ← Prev in thread
Next in thread → Next in month →