[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

[no subject]

[no subject]
When Ive done this in the past I seem to recall normalizing all the @props
specializations to the @props syntax and then evaluating that, but with XSLT 3
you could use XPath maps, which would be easier, i.e.:

<xsl:variable name=propsValues as=map(*)>
  <xsl:map-merge>
    <xsl:apply-templates select=./@* mode=get-props-values/>
  <xsl:map-merge>
</xsl:variable>

Where the keys are condition names and the values are a sequence of Booleans.
You could then use map-left() to get the effective Boolean value for each
condition and compare it to the include/exclude value.

Or maybe Im making it too hard.

Cheers,

E.
_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
servicenow.com<https://www.servicenow.com>
LinkedIn<https://www.linkedin.com/company/servicenow> |
Twitter<https://twitter.com/servicenow> |
YouTube<https://www.youtube.com/user/servicenowinc> |
Facebook<https://www.facebook.com/servicenow>

From: rick@xxxxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tuesday, February 1, 2022 at 12:25 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re:  XSLT for ditaval filtering
[External Email]

Here is my first attempt, which is doing the filtering. With this algorithm, I
would need multiple rules for testing other possible ditaval attributes.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:math="http://www.w3.org/2005/xpath-functions/math"
    exclude-result-prefixes="xs math"
    version="3.0" expand-text="yes">

    <xsl:output indent="yes"/>

    <xsl:param name="ditaval-file"
select="'file:///C:/DATA-10/content/Hide-Prod2.ditaval'"/>

    <xsl:variable name="ditaval" as="document-node()*">
        <xsl:if test="doc-available($ditaval-file)=true()">
            <xsl:sequence select="doc($ditaval-file)"/>
        </xsl:if>
    </xsl:variable>

    <xsl:template match="/map">
        <map>
            <xsl:apply-templates select="@*"/>
            <xsl:apply-templates/>
        </map>
    </xsl:template>

    <xsl:template match="*[@product!=''][$ditaval//prop[@att='product' and
@val=current()/@product and @action='exclude']]"/>
    <xsl:mode on-no-match="shallow-copy"/>

</xsl:stylesheet>

XSL-List info and
archive<https://urldefense.com/v3/__http:/www.mulberrytech.com/xsl/xsl-list__
;!!N4vogdjhuJM!Sv6gz33vX2VZwdjnjFmgR1wfcLtcokfNrGU4X5oP6uzNiwqROmqKE7dnNqkzpr
hT-HgjsQ$>
EasyUnsubscribe<https://urldefense.com/v3/__http:/lists.mulberrytech.com/unsu
b/xsl-list/3453418__;!!N4vogdjhuJM!Sv6gz33vX2VZwdjnjFmgR1wfcLtcokfNrGU4X5oP6u
zNiwqROmqKE7dnNqkzprjWm91pfg$> (by email<>)

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.