Remove wrapping p tag in table entries
Posted: Fri Feb 12, 2016 8:33 pm
Greetings,
I'm dusting off my XPath skills and have forgotten more than I thought. I've done many searches, but have yet to divine an answer. In XSLT, I need to find all cells with a particular type of table and have their entire contents wrapped in a single paragraph element with nothing before or after that tag, and strip out the wrapping p element. I can select the cells I'm after that having only one p tag using the following XPath in Oxygen's XPath debugger:
//table[contains(@outputclass,'BitFieldTable')]//entry[@colname='Description'][count(p) = 1]
However, this p element can be anywhere, and I want to insure that there are no other tags or text nodes before or after it. The DITA in question is generated by upstream processes that have used different DITA generation logic with successive versions of the generator. DeltaXML is seeing these as false positive differences, and I'm creating an XSLT in the pipeline to normalize generator differences before the diff takes place.
As a side question, when I copy the above XPath expression into the XWatch view, nothing appears in the value column. Do the expressions in XWatch only evaluate in the context of running an XSLT stylesheet in the debugger? If so, would creating an identity transform be sufficient?
John
I'm dusting off my XPath skills and have forgotten more than I thought. I've done many searches, but have yet to divine an answer. In XSLT, I need to find all cells with a particular type of table and have their entire contents wrapped in a single paragraph element with nothing before or after that tag, and strip out the wrapping p element. I can select the cells I'm after that having only one p tag using the following XPath in Oxygen's XPath debugger:
//table[contains(@outputclass,'BitFieldTable')]//entry[@colname='Description'][count(p) = 1]
However, this p element can be anywhere, and I want to insure that there are no other tags or text nodes before or after it. The DITA in question is generated by upstream processes that have used different DITA generation logic with successive versions of the generator. DeltaXML is seeing these as false positive differences, and I'm creating an XSLT in the pipeline to normalize generator differences before the diff takes place.
As a side question, when I copy the above XPath expression into the XWatch view, nothing appears in the value column. Do the expressions in XWatch only evaluate in the context of running an XSLT stylesheet in the debugger? If so, would creating an identity transform be sufficient?
John