Applying the standard XSLT copy template,
<xsl:template match="#*|node()">
<xsl:copy>
<xsl:apply-templates select="#*|node()"/>
</xsl:copy>
</xsl:template>
to the JBoss AS 7 standalone.xml, leads to loss of parameters:
<?xml version="1.0" encoding="UTF-8"?><server xmlns="urn:jboss:domain:1.1">
<extensions>
<extension/>
<extension/>
instead of
<?xml version="1.0" encoding="UTF-8"?><server xmlns="urn:jboss:domain:1.1">
<extensions>
<extension module="org.jboss.as.clustering.infinispan"/>
<extension module="org.jboss.as.configadmin"/>
Why?
How can i Make it copy everything?
XSLT transformation is done by Maven XML plugin.
The whole template:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ds="urn:jboss:domain:datasources:1.0"
xmlns="urn:jboss:domain:1.1"
version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="*|#*|node()">
<xsl:copy>
<xsl:apply-templates select="*|#*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Your template appears to be working correctly.
I modified it and the XML to show that is working:
<?xml version="1.0" encoding="UTF-8"?>
<server xmlns="urn:jboss:domain:1.1">
<extensions>
<extension module="org.jboss.as.clustering.infinispan"/>
<extension module="org.jboss.as.configadmin"/>
</extensions>
</server>
Run with this XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ds="urn:jboss:domain:datasources:1.0"
xmlns:so="urn:jboss:domain:1.1"
version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="*|#*|node()">
<xsl:copy>
<xsl:apply-templates select="*|#*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="so:extension">
<xsl:copy>
<xsl:attribute name="testing">just for fun!!</xsl:attribute>
<xsl:copy-of select="#*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Produces:
<?xml version="1.0"?>
<server xmlns="urn:jboss:domain:1.1">
<extensions>
<extension testing="just for fun!!" module="org.jboss.as.clustering.infinispan"/>
<extension testing="just for fun!!" module="org.jboss.as.configadmin"/>
</extensions>
</server>
Here's the output run with your original XSL:
<?xml version="1.0"?>
<server xmlns="urn:jboss:domain:1.1">
<extensions>
<extension module="org.jboss.as.clustering.infinispan"/>
<extension module="org.jboss.as.configadmin"/>
</extensions>
</server>
I downloaded the full JBoss standalone.xml, ran your XSL, and here's the diff of the input and output XML:
so zacharyyoung$ xsltproc so.xsl so.xml > output.xml
so zacharyyoung$ diff so.xml output.xml
1,2c1
< <?xml version='1.0' encoding='UTF-8'?>
<
---
> <?xml version="1.0"?>
Related
I have a XML below, where new lines are added after each line at Note__c tag. I need to produce the XML by splitting them into multiple Note__c tags.
Input XML-
<?xml version="1.0" encoding="UTF-8"?>
<snotification>
<data>
<schema>yify-xjmoeLTbNXA560rHQ</schema>
<payload>
<Note__c>01/15/2020
123456
DFGRTE766
6tgBFR</Note__c>
<Line_Length__c>72.0</Line_Length__c>
<CreatedById>00554000003OENsAAO</CreatedById>
<Contact_Name__c/>
<Sent_By_Name__c>SBM</Sent_By_Name__c>
<CreatedDate>2020-01-15T16:10:40.551Z</CreatedDate>
<Order_Number__c>14831</Order_Number__c>
<Does_not_require_reformatting__c>false</Does_not_require_reformatting__c>
</payload>
<event>
<replayId>139219</replayId>
</event>
</data>
<channel>/event/Order_Note__e</channel>
</snotification>
Where Note__c contains multiple strings with new line added after each(except the last one)
Expected Output -
<?xml version="1.0" encoding="UTF-8"?>
<snotification>
<data>
<schema>yify-xjmoeLTbNXA560rHQ</schema>
<payload>
<Notes>
<Note__c>01/15/2020</Note__c>
<Note__c>123456</Note__c>
<Note__c>DFGRTE766</Note__c>
<Note__c>6tgBFR</Note__c>
</Notes>
<Line_Length__c>72.0</Line_Length__c>
<CreatedById>00554000003OENsAAO</CreatedById>
<Contact_Name__c/>
<Sent_By_Name__c>SBM</Sent_By_Name__c>
<CreatedDate>2020-01-15T16:10:40.551Z</CreatedDate>
<Order_Number__c>14831</Order_Number__c>
<Does_not_require_reformatting__c>false</Does_not_require_reformatting__c>
</payload>
<event>
<replayId>139219</replayId>
</event>
</data>
<channel>/event/Order_Note__e</channel>
</snotification>
I have written this XSLT but it is missing few tags under the payload element -
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<!-- identity transform -->
<xsl:template match="#*|node()">
<xsl:copy>
<xsl:apply-templates select="#*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="snotification/data/payload">
<Notes>
<xsl:for-each select="tokenize(Note__c,'\n')">
<Note__c>
<xsl:value-of select="."/>
</Note__c>
</xsl:for-each>
</Notes>
</xsl:template>
</xsl:stylesheet>
Output of this-
<?xml version="1.0" encoding="UTF-8"?>
<snotification>
<data>
<schema>yify-xjmoeLTbNXA560rHQ</schema>
<Notes>
<Note__c>01/15/2020</Note__c>
<Note__c> 123456</Note__c>
<Note__c> DFGRTE766</Note__c>
<Note__c> 6tgBFR</Note__c>
</Notes>
<event>
<replayId>139219</replayId>
</event>
</data>
<channel>/event/Order_Note__e</channel>
</snotification>
not sure what is missing.
Thanks
Sugata
Change your XSLT to
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<!-- identity transform -->
<xsl:template match="#*|node()">
<xsl:copy>
<xsl:apply-templates select="#*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="snotification/data/payload/Note__c">
<Notes>
<xsl:for-each select="tokenize(.,'\n')">
<Note__c>
<xsl:value-of select="normalize-space(.)"/>
</Note__c>
</xsl:for-each>
</Notes>
</xsl:template>
</xsl:stylesheet>
The output should be as desired.
I have xml code and I want to put two xml tags in the beginning of the xml code so all the code will come under those two tags
Any ideas how to achieve that with XSLT? I am a newby to XSLT and tried the whole day in vain... Any help would really be appreciated.
I have an XML that looks like this
<?xml version="1.0" encoding="UTF-8"?>
<ns0:PCN xmlns:ns0="abc">
<PCD>
<PC>
<TID>123456</TID>
<Sequence>1</Sequence>
<Type>M</Type>
</PC>
<PC>
<TID>123457</TID>
<Sequence>2</Sequence>
<Type>M</Type>
</PC>
</PCD>
</ns0:PCN>
and I need to transform it to look like this:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="xyz">
<ns0:Message1>
<ns0:PCN xmlns:ns0="abc">
<PCD>
<PC>
<TID>123456</TID>
<Sequence>1</Sequence>
<Type>M</Type>
</PC>
<PC>
<TID>123457</TID>
<Sequence>2</Sequence>
<Type>M</Type>
</PC>
</PCD>
</ns0:PCN>
</ns0:Message1>
</ns0:Messages>
Please find below my attempted code. This is my first try and I have written this after referring to several codes of xslt . It is not giving me desired result.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- Identity transform -->
<xsl:template match="#* | node()">
<xsl:copy>
<xsl:apply-templates select="#* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="ns0:PCN">
<xsl:copy-of select="."/>
<ns0:Messages xmlns:ns0="xyz"/>
<ns0:Message1/>
</xsl:template>
</xsl:stylesheet>
How about simply:
XSLT 1.0
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<ns0:Messages xmlns:ns0="xyz">
<ns0:Message1>
<xsl:copy-of select="*"/>
</ns0:Message1>
</ns0:Messages>
</xsl:template>
Demo: https://xsltfiddle.liberty-development.net/3NJ38ZK
</xsl:stylesheet>
I have several XML files, as follows:
file : 1.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config>
<info>
<info1>val1</info1>
<info2>val2</info2>
</info>
<info>
<info1>val3</info1>
<info2>val4</info2>
</info>
</config>
file : 2.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config>
<info>
<info1>val5</info1>
<info2>val6</info2>
</info>
<info>
<info1>val7</info1>
<info2>val8</info2>
</info>
</config>
file: 3.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config>
<info>
<info1>val9</info1>
<info2>val10</info2>
</info>
<info>
<info1>val11</info1>
<info2>val12</info2>
</info>
</config>
using XSLT2.0 (saxon), I would like to merge them and also add to each node:
<info3>XXX</info3>
and also
<file>filename.xml</file>
filename.xml was the file from which the info has been copied.
The output should look like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config>
<info>
<info1>val1</info1>
<info2>val2</info2>
<info3>XXX</info3>
<file>1.xml</file>
</info>
<info>
<info1>val3</info1>
<info2>val4</info2>
<info3>XXX</info3>
<file>1.xml</file>
</info>
<info>
<info1>val5</info1>
<info2>val6</info2>
<info3>XXX</info3>
<file>2.xml</file>
</info>
<info>
<info1>val7</info1>
<info2>val8</info2>
<info3>XXX</info3>
<file>2.xml</file>
</info>
<info>
<info1>val9</info1>
<info2>val10</info2>
<info3>XXX</info3>
<file>3.xml</file>
</info>
<info>
<info1>val11</info1>
<info2>val12</info2>
<info3>XXX</info3>
<file>3.xml</file>
</info>
</config>
So far I have been able to merge the file by creating an XML file that lists the file I want to merge (merge.xml):
<mergeData newRoot="config">
<filelist>
<fileItem>1.xml</fileItem>
<fileItem>2.xml</fileItem>
<fileItem>3.xml</fileItem>
</filelist>
</mergeData>
using the following XSL (merge.xsl):
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0" exclude-result-prefixes="#all">
<xsl:param name="new">
<info>XXX</info>
</xsl:param>
<xsl:template match="/">
<xsl:element name="{mergeData/#newRoot}">
<xsl:apply-templates select="mergeData/fileList/fileItem"/>
</xsl:element>
</xsl:template>
<xsl:template match="fileItem">
<xsl:apply-templates select="document(translate(., '\', '/'))/config/*"/>
</xsl:template>
<xsl:template match="config/*">
<xsl:copy>
<xsl:copy-of select="node()"/>
<xsl:copy-of select="$new"/>
</xsl:copy>
<file><xsl:value-of select="tokenize(document-uri(.), '/')[last()]"/></file>
</xsl:template>
How should I modify the XSL to get the filename into each info at the same time.
Really the only thing you should have to do is move file inside of the xsl:copy.
Example (with a couple of other minor mods):
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0" exclude-result-prefixes="#all">
<xsl:output indent="yes"/>
<xsl:param name="new">
<info3>XXX</info3>
</xsl:param>
<xsl:template match="/">
<xsl:element name="{mergeData/#newRoot}">
<xsl:apply-templates select="mergeData/filelist/fileItem"/>
</xsl:element>
</xsl:template>
<xsl:template match="fileItem">
<xsl:apply-templates select="document(translate(., '\', '/'))/config/*"/>
</xsl:template>
<xsl:template match="config/*">
<xsl:copy>
<xsl:copy-of select="node(),$new"/>
<file><xsl:value-of select="tokenize(document-uri(/), '/')[last()]"/></file>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
You could also do this using collection() instead of creating the separate mergeData.xml file:
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:param name="newRoot" select="'config'"/>
<xsl:param name="new">
<info3>XXX</info3>
</xsl:param>
<xsl:template match="/">
<xsl:element name="{$newRoot}">
<xsl:apply-templates select="collection('file:///C:/some/path?select=[0-9]*.xml')/*/info"/>
</xsl:element>
</xsl:template>
<xsl:template match="info">
<xsl:copy>
<xsl:copy-of select="#*|node(),$new"/>
<file><xsl:value-of select="tokenize(document-uri(/),'/')[last()]"/></file>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
One additional alternative, since you're using Saxon, is to use saxon:discard-document() along with your mergeData.xml input. If you have a lot of files listed in mergeData.xml, this can help with memory consumption. (It does require Saxon PE or EE or an older version of Saxon that allows the extension functions.)
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:param name="new">
<info3>XXX</info3>
</xsl:param>
<xsl:template match="/mergeData">
<xsl:element name="{#newRoot}">
<xsl:apply-templates select="filelist/fileItem"/>
</xsl:element>
</xsl:template>
<xsl:template match="fileItem">
<xsl:apply-templates select="document(.)/saxon:discard-document(.)/*/*" xmlns:saxon="http://saxon.sf.net/"/>
</xsl:template>
<xsl:template match="info">
<xsl:copy>
<xsl:copy-of select="#*|node(),$new"/>
<file><xsl:value-of select="tokenize(document-uri(/),'/')[last()]"/></file>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
The following XSLT yields your required result:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:param name="new">
<info>XXX</info>
</xsl:param>
<xsl:template match="/mergeData">
<config>
<xsl:for-each select="filelist/fileItem">
<xsl:variable name="filename" select="text()"/>
<xsl:for-each select="document($filename)/config/info">
<info>
<xsl:copy-of select="./*"/>
<xsl:element name="info{count(*)+1}">
<xsl:value-of select="$new"/>
</xsl:element>
<file><xsl:value-of select="$filename"/></file>
</info>
</xsl:for-each>
</xsl:for-each>
</config>
</xsl:template>
</xsl:stylesheet>
Notes:
This already works with XSLT 1.0, hence I changed the XSLT declaration.
Since this approach is top down with a predefined sub structure it does not use the attribute newRoot of your input file anymore.
The answer does not extract the basename of your input files but uses the full path supplied in the merge configuration. You may want to revert this simplification. Of course, using tokenize pushes it back to XSLT 2.0 or extended functions.
Input:
<chapter xmlns='http://www.w3.org/1998/Math/MathML'>
<math>
<mtext mathcolor="#3e9a3c">This is sample 1</mtext>
<mtext mathcolor="#009bd2">This is sample 2</mtext>
</math>
</chapter>
Output:
<?xml version='1.0' encoding='UTF-8' ?>
<chapter xmlns="http://www.w3.org/1998/Math/MathML"><math>~COLOR~[Green]This is sample 1~COLOR~[Red]This is sample 2</math></chapter>
Configuration file:
<?xml version="1.0"?>
<colors>
<color><mathcolor>#3e9a3c</mathcolor><textcolor>Green</textcolor><colorvalue>1</colorvalue></color>
<color><mathcolor>#009bd2</mathcolor><textcolor>Red</textcolor><colorvalue>2</colorvalue></color>
</colors>
XSLT tried:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML">
<xsl:output method="xml" encoding="UTF-8" indent="no"/>
<xsl:strip-space elements="*"/>
<xsl:template match="#* | node()">
<xsl:copy>
<xsl:apply-templates select="#* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="m:mtext">
<xsl:if test="#mathcolor">
<xsl:choose>
<xsl:when test="#mathcolor='#3e9a3c'"><xsl:text disable-output-escaping="yes">~COLOR~[Green]</xsl:text></xsl:when>
<xsl:when test="#mathcolor='#009bd2'"><xsl:text disable-output-escaping="yes">~COLOR~[Red]</xsl:text></xsl:when>
</xsl:choose>
</xsl:if>
<xsl:apply-templates/></xsl:template>
</xsl:stylesheet>
I am in need to transform the Input given above to the required output based on the configuration file. If the user updates the configuration file, and if the Input has mathcolor attribute value, then its corresponding color should be transformed as shown in output. I can able to use XSLT 1.0. Kindly help to solve this issue
For example:
If the user adds the below coding in the configuration file:
<color><mathcolor>#007c62</mathcolor><textcolor>Magenta</textcolor><colorvalue>3</colorvalue></color> and Input contains mathcolor="#007c62", then Magenta should be applied in the output.
This should work:
Stylesheet
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.w3.org/1998/Math/MathML">
<xsl:output method="xml" encoding="UTF-8" indent="no"/>
<xsl:strip-space elements="*"/>
<!--
Config file name/path, can be passed as a parameter to XSL transformation
-->
<xsl:param name="config.file" select="'config.xml'"/>
<xsl:template match="#* | node()">
<xsl:copy>
<xsl:apply-templates select="#* | node()"/>
</xsl:copy>
</xsl:template>
<!-- <m:mtext> elements with a #mathcolor attribute, no need for <xsl:if> -->
<xsl:template match="m:mtext[#mathcolor]">
<xsl:text>~COLOR~[</xsl:text>
<!--
Fetch color name from $config.file (<color> element with a <mathcolor>
child that has the same value as the #mathcolor attribute of the element
currently being processed)
-->
<xsl:value-of
select="document($config.file)/colors/color
[mathcolor = current()/#mathcolor]/textcolor"/>
<xsl:text>]</xsl:text>
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
Input
<chapter xmlns='http://www.w3.org/1998/Math/MathML'>
<math>
<mtext mathcolor="#3e9a3c">This is sample 1</mtext>
<mtext mathcolor="#009bd2">This is sample 2</mtext>
</math>
</chapter>
config.xml
<?xml version="1.0"?>
<colors>
<color>
<mathcolor>#3e9a3c</mathcolor>
<textcolor>Green</textcolor>
<colorvalue>1</colorvalue>
</color>
<color>
<mathcolor>#009bd2</mathcolor>
<textcolor>Red</textcolor>
<colorvalue>2</colorvalue>
</color>
</colors>
Output
<?xml version="1.0" encoding="UTF-8"?>
<chapter xmlns="http://www.w3.org/1998/Math/MathML">
<math>~COLOR~[Green]This is sample 1~COLOR~[Red]This is sample 2</math>
</chapter>
I have XML
<getInquiryAboutListReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<inquiryAbouts>
<inquiryAbout>
<code>Code</code>
<nameKk>Something</nameKk>
<nameRu>Something</nameRu>
<documents xsi:nil="true"/>
</inquiryAbout>
</inquiryAbouts>
</getInquiryAboutListReturn>
And I want to process it with XSLT to copy all XML
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output indent="yes" />
<xsl:template match="/">
<xsl:copy-of select="//getInquiryAboutListReturn/inquiryAbouts"/>
</xsl:template>
</xsl:stylesheet>
How could I copy all XML without <documents xsi:nil="true"/> or without xsi:nil="true"?
Desired output XML
<getInquiryAboutListReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<inquiryAbouts>
<inquiryAbout>
<code>Code</code>
<nameKk>Something</nameKk>
<nameRu>Something</nameRu>
</inquiryAbout>
</inquiryAbouts>
</getInquiryAboutListReturn>
This simple XSLT:
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0">
<xsl:output omit-xml-declaration="no" indent="yes"/>
<xsl:strip-space elements="*"/>
<!-- TEMPLATE #1 -->
<xsl:template match="node()|#*">
<xsl:copy>
<xsl:apply-templates select="node()|#*"/>
</xsl:copy>
</xsl:template>
<!-- TEMPLATE #2 -->
<xsl:template match="*[#xsi:nil = 'true']" />
</xsl:stylesheet>
...when applied to the OP's source XML:
<?xml version="1.0"?>
<getInquiryAboutListReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<inquiryAbouts>
<inquiryAbout>
<code>Code</code>
<nameKk>Something</nameKk>
<nameRu>Something</nameRu>
<documents xsi:nil="true"/>
</inquiryAbout>
</inquiryAbouts>
</getInquiryAboutListReturn>
...produces the expected result XML:
<?xml version="1.0"?>
<getInquiryAboutListReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<inquiryAbouts>
<inquiryAbout>
<code>Code</code>
<nameKk>Something</nameKk>
<nameRu>Something</nameRu>
</inquiryAbout>
</inquiryAbouts>
</getInquiryAboutListReturn>
EXPLANATION:
The first template -- the Identity Template -- copies all nodes and attributes from the source XML document as-is.
The second template, which matches all elements with the specified, namespaced attribute equalling "true", effectively removes those elements.