I was given a XSLT-file which looks like this (only the relevant part):
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xls="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:step="http://www.stibosystems.com/step"
xmlns="http://www.stibosystems.com/step"
exclude-result-prefixes="xs xls">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<xsl:copy-of select="$newShopDoc/STEP-ProductInformation/AttributeList/Attribute[starts-with(xs:string(@ID), 'PA_')]" />
</xsl:copy>
I also tried this approach, as suggested:
<xsl:copy-of select="$newShopDoc/STEP-ProductInformation/AttributeList/Attribute[starts-with(xs:string(@ID), 'PA_')][not(@ID='PA_VENDOR')]" />
Now there was a change-request, to copy all elements, except one in particular. All elements are prefixed with a PA_
and so is the element, which shouldn't be copied. There are like 100 elements, so I really don't want to write every single element I need and leave out the one I don't need.
I read a bit into it and thus far, I can only see a solution in building a sub-structure with an if
condition.
From what I saw though, there might be a solution with parentheses and the and
keyword, but I havn't found the solution.
I'm not familiar with XSLT and there is probably an easy way to achieve my goal.
The element I want to exclude is called PA_VENDOR
. Is it also possible to exclude more than 1 element, even though it isn't yet requested?