Jul. 10, 2018 11:00 AM EDT
| By XMLDEV Mailing List: An Email Discussion Forum for W3C XML technologies and XML development trends. | Article Rating: |
|
| September 24, 2008 09:00 AM EDT | Reads: |
252 |
Thanks Manos for sharing your experience and insights. An XML Db is not an option since the standard needs to support relational persistence of the XML docs as well. I am leaning towards your option 2. What I am thinking is that the request will include a parameterize query invocation (a regrep feature that is similar to stored query invocation and does not expose query syntax) to select the objects to update. It may also contain references to specific objects to update as another element. It will also contain an XPATH expression to select what attribute or element is to be replaced. Finally it will contain a replacement for the attribute value or element. If multiple elements are matched by XPATH expression then that would be a request error. Thanks again. Manos Batsis wrote: > Farrukh Najmi wrote: >> Another option might be to use simpler XPath/XSLT expressions to do >> the same. >> >> Does any one have any experience or advice on how best to do this. > > A proper way to do this would be an XML store and xquery or whatnot. > However, most project budgets do not include that and seek such > solutions for a very small subset of what the project actually does. > > Couple of years ago i did this two ways for a server side java app. In > the first approach, the request body was always an > identity_transform_based XSLT document. An identity transform is one > whose transformation result tree is the same as the input tree. > > So, besides the identity template, that XSLT had other templates as > desired. For example, suppose you only wanted to change the first > heading of a document you could just use two templates: > > > > <xsl:template match="@*|node()"> > <xsl:copy> > <xsl:apply-templates select="@*|node()"/> > </xsl:copy> > </xsl:template> > > <xsl:template match="//heading[1]"> > <xsl:copy> > <xsl:text> added text </xsl:text> > </xsl:copy> > </xsl:template> > > In the second approach, i was sending two things with each request: an > HTTP param containing an XPath expression and a request body with the > XML to replace the node matched by the XPath expression. > > Both where sort of quick and dirty solutions but worked. In the first > approach, the downside was that you had to take some care with the > templates to avoid changing the wrong nodes. In the second approach > you had somewhat limited capabilities as you essentially just replaced > a node or fragment in the target document. > > I intended to add a third hybrid approach where an XPath expression > would be used to extract a fragment from the target document and an > XSLT would be used to transform that before putting it back but the > actual need never came up. > > All document changes were versioned ;-) > > Hope this helps. > > Cheers, > > Manos > -- Regards, Farrukh Najmi Web: http://www.wellfleetsoftware.com
CIO, CTO & Developer Resources
Read the original blog entry...
Published September 24, 2008 Reads 252
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
IoT & Smart Cities Stories
By Zakia Bouachraoui Jul. 10, 2018 09:45 AM EDT |
By Yeshim Deniz Jul. 10, 2018 09:30 AM EDT |
By Liz McMillan Jul. 10, 2018 09:15 AM EDT |
By Yeshim Deniz Jul. 9, 2018 07:45 PM EDT |
By Pat Romanski Jul. 8, 2018 02:00 PM EDT |
By Liz McMillan SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY.
CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...Jul. 4, 2018 04:45 PM EDT Reads: 4,336 |
By Yeshim Deniz Jul. 3, 2018 03:45 PM EDT Reads: 3,571 |
By Elizabeth White Jul. 3, 2018 11:45 AM EDT Reads: 2,279 |
By Pat Romanski Jul. 3, 2018 08:30 AM EDT Reads: 2,941 |


SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY.
CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...

CloudEXPO New York 2018, colocated with DevOpsSUMMIT and DXWorldEXPO New York 2018 will be held November 12-13, 2018, in New York City and will bring together Cloud Computing, FinTech and Blockchain, Digital Transformation, Big Data, Internet of Things, DevOps, AI and Machine Learning to one location.












