how to Merge two xml files with XSLT

Pretty much the same answer as I provided to your last question, modified to match your new XML format: <xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”> <xsl:output method=”xml” indent=”yes”/> <xsl:param name=”fileName” select=”‘updates.xml'” /> <xsl:param name=”updates” select=”document($fileName)” /> <xsl:variable name=”updateItems” select=”$updates/feed/entry” /> <xsl:template match=”@* | node()”> <xsl:copy> <xsl:apply-templates select=”@* | node()”/> </xsl:copy> </xsl:template> <xsl:template match=”feed”> <xsl:copy> <xsl:apply-templates select=”@* | node()[not(self::entry)] … Read more

How to configure Spring Data JPA using XML

If you want to configure Spring Data JPA by using XML configuration (and use the configuration described in the book), you have to follow these steps: Configure the data source bean. Configure the entity manager factory bean. Configure the transaction manager bean. Enable annotation driven transaction management. Configure Spring Spring Data JPA. The application context … Read more

If double slash (//) is used 2 times in XPath, what does it mean?

A double slash “//” means any descendant node of the current node in the HTML tree which matches the locator. A single slash “/” means a node which is a direct child of the current. //div[@id=’add’]//span[@id=addone’] will match: <div id=”add”> <div> <span id=”addone”> </div> </div> And: <div id=”add”> <span id=”addone”> </div> //div[@id=’add’]/span[@id=addone’] will match only … Read more

How does the billion laughs XML DoS attack work?

The Billion Laughs attack is a denial-of-service attack that targets XML parsers. The Billion Laughs attack is also known as an XML bomb, or more esoterically, the exponential entity expansion attack. A Billion Laughs attack can occur even when using well-formed XML and can also pass XML schema validation. The vanilla Billion Laughs attack is … Read more

Get nodes where child node contains an attribute

Try //book[title/@lang = ‘it’] This reads: get all book elements that have at least one title which has an attribute lang with a value of “it” You may find this helpful — it’s an article entitled “XPath in Five Paragraphs” by Ronald Bourret. But in all honesty, //book[title[@lang=’it’]] and the above should be equivalent, unless … Read more