Need help using a data element for PDF cover processing
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 118
- Joined: Mon Apr 19, 2010 5:33 pm
Need help using a data element for PDF cover processing
Hello,
I have a few select attributes (props, otherprops, etc) that I have been using for processing items such as date and subtitle for PDF cover pages. I understand how to call the map elements in the XSL file (<xsl:variable name="otherprops">), but not how to call the name and value of a data element in this context.
<map>
<data>
<data>
<topicref>
<topicref>
...
Can anyone suggest some help please? Thanks!
I have a few select attributes (props, otherprops, etc) that I have been using for processing items such as date and subtitle for PDF cover pages. I understand how to call the map elements in the XSL file (<xsl:variable name="otherprops">), but not how to call the name and value of a data element in this context.
<map>
<data>
<data>
<topicref>
<topicref>
...
Can anyone suggest some help please? Thanks!
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Need help using a data element for PDF cover processing
Hi,
I'm sorry but I don't quite understand all your setup.
So if at some point in the DITA Map you have a construct like:
then in the XSLT you can retrieve the value of the element using an XPath like:
Regards,
Radu
I'm sorry but I don't quite understand all your setup.
So if at some point in the DITA Map you have a construct like:
Code: Select all
<topicmeta>
........
<data name="X" value="Y"></data>
....
</topicmeta>
Code: Select all
<xsl:value-of select="(//data[@name='X'])[1]/@value"/>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 118
- Joined: Mon Apr 19, 2010 5:33 pm
Re: Need help using a data element for PDF cover processing
Thanks for the reply, Radu
The code that I am using to call the select attributes looks like this:
So, really, I think the issue is how to test if the data element (<data name="pubdate" value="May 2015"/>) exists in the test. It appears I cannot call the string you provided in the test, or at least how to configure it properly.
Thanks for your help! Greatly appreciated!
The code that I am using to call the select attributes looks like this:
Code: Select all
<xsl:variable name="otherprops">
<!-- Date: Insert the Revision Month and Year -->
<xsl:choose>
<xsl:when test="//*[contains(@class,' bkinfo/bkinfo ')]">
<xsl:value-of select="//*[contains(@class,' bkinfo/bkinfo ')]/*[contains(@class,' topic/otherprops ')]"></xsl:value-of>
<xsl:apply-templates select="//*[contains(@class,' bkinfo/bkinfo ')]/@id"/>
</xsl:when>
<xsl:when test="string(@otherprops)"><xsl:value-of select="string(@otherprops)"/></xsl:when>
<xsl:when test="normalize-space(otherprops)"><xsl:value-of select="otherprops"/></xsl:when>
<xsl:otherwise>
<fo:block color="red">[No date was entered. Enter the Month and Year (ex. April 2011) in the otherprops attribute]</fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Thanks for your help! Greatly appreciated!
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Need help using a data element for PDF cover processing
Hi,
I'm sorry but I do not have enough details to help further. I do not know the entire XSLT customization you made.
In my previous example I was trying to show you how an XPath which searches for that data value should look like but you need to adapt my example to your particular situation.
Maybe you could also write about this on the DITA Users List:
https://groups.yahoo.com/neo/groups/dita-users/info
Regards,
Radu
I'm sorry but I do not have enough details to help further. I do not know the entire XSLT customization you made.
In my previous example I was trying to show you how an XPath which searches for that data value should look like but you need to adapt my example to your particular situation.
Maybe you could also write about this on the DITA Users List:
https://groups.yahoo.com/neo/groups/dita-users/info
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service