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

transform @xml:id to @id in HTML

From
Michel van den Burg <>
Date
2021-03-10T16:15:02+00:00
ID
Thread
transform @xml:id to @id in HTML
Hi everyone,

 

Iâm still struggling with this question, so hopefully this message is read by one of the DocBook masterminds. ;-)

 

Iâm wondering if itâs possible to include all the xml:idâs we add in our DocBook source document in the output HTML als idâs.

 

For example:

 

DocBook XML:

<para xml:id=âtestâ>â</para>

 

HTML

<p id=âtestâ>â</p>

 

The parameter
generate.id.attributes handles this for the main sections, but I would like to add all the idâs. Is this possible?

 

Thanks in advance!

 

Kind regards,

 

Michel van den Burg

digital publishing | Uitgeverij Coutinho

06 - 10 75 75 14

LinkedIn

 

 

 

Van: Michel van den Burg <>

Verzonden: vrijdag 5 maart 2021 12:34

Aan: 

Onderwerp: RE: [docbook-apps] transform title/@xml:id to title/@id in HTML

 

Hi Peter,

 

Thanks for your suggestion! I igree that one must try to avoid âhackingâ if possible. Adding IDâs (from the source document) to more
 elements than the main sections seems like a very common wish, though. We would like to add internal links to lots of places, thatâs why we want to transform xml:id to id.

 

Does anyone else know if the 1.0-stylesheets have a setting to transfer all xml:idâs to the output? Or is Peterâs suggestion the way
 to go?

 

Many thanks,

 

Michel

 

Van: Peter Desjardins <>

Verzonden: donderdag 4 maart 2021 05:43

Aan: Michel van den Burg <>

CC: 

Onderwerp: Re: [docbook-apps] transform title/@xml:id to title/@id in HTML

 

Hi, Michel!

 

I would consider customizing the d:title template and setting the output id value to whatever the input xml:id value is.

 

  
https://github.com/docbook/xslt10-stylesheets/blob/master/xsl/html/titlepage.xsl#L1037

 

My idea feels like a hack though. Maybe someone else has a better solution?

 

Peter

 

On Wed, Mar 3, 2021 at 7:17 AM Michel van den Burg <> wrote:

Hi everyone,

I'm using the DocBook XSL to transform DocBook XML to EPUB and HTML. I have a question about including xml:id in the output as id's.

I know that it's possible to include the xml:id of main sections in the output using generate.id.attributes. I also have xml:id's in some of my <title>-elements, and I would like to add these in my output too, like this:

Input:

<preface><title xml:id="12345">...</title></preface>

Output:

<section class="preface" title="Frontispice" epub:type="preface" id="56789">

  <div class="titlepage">

    <div>

      <div>

        <h1 class="title" id="12345">Frontispice</h1>

      </div>

    </div>

  </div>

</section>

Is there a way to do this? 

Thanks in advance,

Kind regards,

Michel

---------------------------------------------------------------------

To unsubscribe, e-mail: 


For additional commands, e-mail: 
← Prev in month ← Prev in thread
Next in thread → Next in month →