473,804 Members | 3,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML to XML transformation using XSL.

4 New Member
Hi All,

I am writing an XSL to transform the XML to XML.Only change i need in xml is to add the value for the price element
under book tag for which publisher location is "World".
The value for the price tag should be the sum of the value of price tag of two book tags (location for one is US and location of other is India).

here is the snippets from the code:

Expand|Select|Wrap|Line Numbers
  1. book.xml
  2.         ---------------------------------------------------
  3.  
  4.         <?xml version="1.0" encoding="ISO-8859-1"?>
  5. <?xml-stylesheet type="text/xsl" href="test.xsl"?>
  6. <booklist>
  7. <book>
  8.     <publisher>
  9.         <location>India</location>
  10.         <identity id="111">book.com</identity>
  11.     </publisher>
  12. <title>bookname1</title>
  13. <price>80</price>
  14.  
  15. </book>
  16.  
  17.  
  18.  
  19. <book>
  20.     <publisher>
  21.         <location>US</location>
  22.         <identity id="222">usbook.com</identity>
  23.     </publisher>
  24. <title>bookname2</title>
  25. <price>60</price>
  26.  
  27. </book>
  28.  
  29. <book>
  30.     <publisher>
  31.         <location>UK</location>
  32.         <identity id="333">ukbook.com</identity>
  33.     </publisher>
  34. <title>bookname3</title>
  35. <price>50</price>
  36.  
  37. </book>
  38.  
  39. <book>
  40.     <publisher>
  41.         <location>Singapore</location>
  42.         <identity id="444">sgbook.com</identity>
  43.     </publisher>
  44. <title>bookname4</title>
  45. <price>50</price>
  46.  
  47. </book>
  48.  
  49.  
  50. <book>
  51.     <publisher>
  52.         <location>World</location>
  53.         <identity id="000">worldbook.com</identity>
  54.     </publisher>
  55. <title>bookname5</title>
  56. <price></price>
  57.  
  58. </book>
  59. </booklist>
  60.  
  61.  
  62.  
  63. ---------------------------------------------------
Expand|Select|Wrap|Line Numbers
  1. ----------------book.xsl--------------------------
  2.  
  3. <?xml version="1.0" encoding="UTF-8"?>
  4. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  5. <xsl:output method="xml" media-type="text/xml" omit-xml-declaration="yes" version="1.0" />
  6.  
  7. <xsl:template match="/ | @* | node()">
  8. <xsl:copy>
  9. <xsl:apply-templates select="@* | node()"/>
  10. </xsl:copy>
  11. </xsl:template>
  12.  
  13. <xsl:template match="bookList/book" >
  14.  
  15.  
  16.     <xsl:copy>
  17.         <xsl:apply-templates select="@* | node()"/>
  18.  
  19.             <xsl:if test="(publisher/location = 'India')"> 
  20.             <xsl:if test="(publisher/identity[@id] = '111')"> 
  21.                  <xsl:variable name="A1SoloTotal"><xsl:value-of select="//booklist/book/price"/></xsl:variable>
  22.             </xsl:if> 
  23.             </xsl:if> 
  24.  
  25.             <xsl:if test="(publisher/location = 'US')"> 
  26.             <xsl:if test="(publisher/identity[@id] = '222')"> 
  27.                  <xsl:variable name="A2SoloTotal"><xsl:value-of select="//booklist/book/price"/></xsl:variable>
  28.             </xsl:if> 
  29.             </xsl:if> 
  30.  
  31.             <xsl:if test="(publisher/location = 'World')"> 
  32.             <xsl:if test="(publisher/identity[@id] = '000')"> 
  33.                  <price><xsl:value-of select='$A1SoloTotal'+'$A2SoloTotal'/></price>
  34.             </xsl:if> 
  35.             </xsl:if> 
  36.  
  37.     </xsl:copy>
  38.  
  39. </xsl:template>
  40.  
  41. </xsl:stylesheet>






please get back to me today if you can help in any way.

thanks

Shakil
Sep 12 '08 #1
9 1806
Dormilich
8,658 Recognized Expert Moderator Expert
what exactly is your problem? at the first glance I don't see a mistake in the code (well, I had no time testing yet)
except one writing mistake, 'booklist/book' (template) and the value-of XPath (you're already starting at book, therefore: "price" (not "//booklist/book/price")

when I understand it right, you want: price(world) = price(US) + price(India) ? do you have in <booklist> only one book of US and India? or are there other constraints too?

regards
Sep 12 '08 #2
shakilalig
4 New Member
what exactly is your problem? at the first glance I don't see a mistake in the code (well, I had no time testing yet)
except one writing mistake, 'booklist/book' (template) and the value-of XPath (you're already starting at book, therefore: "price" (not "//booklist/book/price")

when I understand it right, you want: price(world) = price(US) + price(India) ? do you have in <booklist> only one book of US and India? or are there other constraints too?

regards
----------------------------------------------------------------------------------------------------------------
Thanks for your review.
The issue is with the declaration of variable The variable is not getting accessible in the clause where we are looking for the sum.

price(world) = price(US) + price(India) ? this is right

<xsl:if test="(publishe r/location = 'World')">
<xsl:if test="(publishe r/identity[@id] = '000')">
<price><xsl:val ue-of select='$A1SoloTotal' + '$A2SoloTotal' /></price>
</xsl:if>
</xsl:if>

For first price Constraint is that the location should be US and id=222 .
For second price Constraint is that the location should be India and id=111.

Those two should go as the sum for the book tag having location World and id="000"
I hope it clears the issue?

The first issue is getting access to variable declared in different if clauses.


The other is how to put this as the sum for an element with blank text value?
Sep 12 '08 #3
Dormilich
8,658 Recognized Expert Moderator Expert
after a bit of testing, I came to the conclusion that all XPath expressions were somehow screwed up.
Expand|Select|Wrap|Line Numbers
  1. ----------------book.xsl--------------------------
  2.  
  3. <?xml version="1.0" encoding="UTF-8"?>
  4. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  5. <xsl:output method="xml" media-type="text/xml" omit-xml-declaration="yes" version="1.0" />
  6.  
  7. <xsl:template match="/ | @* | node()">
  8.   <xsl:copy>
  9.     <xsl:apply-templates select="@* | node()"/>
  10.   </xsl:copy>
  11. </xsl:template>
  12.  
  13. <xsl:template match="bookList/book" >
  14.   <xsl:copy>
  15.     <xsl:apply-templates select="@* | node()"/>
  16.     <xsl:if test="(publisher/location = 'India')">
  17.       <xsl:if test="(publisher/identity[@id] = '111')">
  18.         <xsl:variable name="A1SoloTotal"><xsl:value-of select="//booklist/book/price"/></xsl:variable>
  19.       </xsl:if>
  20.     </xsl:if>
  21.  
  22.     <xsl:if test="(publisher/location = 'US')">
  23.       <xsl:if test="(publisher/identity[@id] = '222')">
  24.         <xsl:variable name="A2SoloTotal"><xsl:value-of select="//booklist/book/price"/></xsl:variable>
  25.       </xsl:if>
  26.     </xsl:if>
  27.  
  28.     <xsl:if test="(publisher/location = 'World')">
  29.       <xsl:if test="(publisher/identity[@id] = '000')">
  30.         <price><xsl:value-of select='$A1SoloTotal'+'$A2SoloTotal'/></price>
  31.       </xsl:if>
  32.     </xsl:if>
  33.   </xsl:copy>
  34. </xsl:template>
  35.  
  36. </xsl:stylesheet>
I left out the xsl:copy because I didn't know what exactly you want to copy (so I concentrated on the 'world' issue), still
- why defining xsl:copy twice (inside and outside the second template)?
- if you want to copy a node without making any changes consider xsl:copy-of

getting the world value:
- the xsl:template and xsl:apply-templates XPath looped for every book element, changed that to loop for every booklist (for the sole computation this was easier to start with)
- the xsl:variable's XPath returned a node-set: //booklist/book/price are all price elements (in your case), changed that to price (book/price respectivly, since I loop now for booklist), which is now relatively declared and thus a single node (resp. its string-value).
- I dropped the xsl:if conditions in favour of one XPath expression in xsl:variable using select attribute
- shortened the 'world' xsl:if to one condition (there's no need of two xsl:ifs)
- the syntax of the computation is wrong (missing quotation marks)

so finally I came up with
Expand|Select|Wrap|Line Numbers
  1. <xsl:template match="/">
  2.     <xsl:apply-templates />
  3. </xsl:template>
  4.  
  5. <xsl:template match="booklist">
  6.     <xsl:variable name="A1SoloTotal" select="book/price[../descendant::location = 'India'][../descendant::identity/@id = '111']"/>
  7.     <xsl:variable name="A2SoloTotal" select="book/price[../descendant::location = 'US'][../descendant::identity/@id = '222']"/>
  8.     <xsl:if test="book/price[../descendant::location = 'World'][../descendant::identity/@id = '000']">
  9.         <price><xsl:value-of select="$A1SoloTotal + $A2SoloTotal"/></price>
  10.     </xsl:if>
  11. </xsl:template>
there is still room for improvement (we could even make a parameter-dependent template.... depending on the file).

In the copy case I guess you want to copy the whole xml file with the value for 'World' inserted... there may be adaptions necessary. And I can probably think of a more elegant copy cycle, but this depends on the xml file.

regards
Sep 12 '08 #4
Dormilich
8,658 Recognized Expert Moderator Expert
oops, missed your first reply while posting #4

The issue is with the declaration of variable The variable is not getting accessible in the clause where we are looking for the sum.

Expand|Select|Wrap|Line Numbers
  1. <xsl:if test="(publisher/location = 'World')"> 
  2.     <xsl:if test="(publisher/identity[@id] = '000')"> 
  3.          <price><xsl:value-of select='$A1SoloTotal' + '$A2SoloTotal'  /></price>
  4.     </xsl:if> 
  5. </xsl:if>
this is because there's a syntax error. it is
Expand|Select|Wrap|Line Numbers
  1. // either
  2. <xsl:value-of select="'$A1SoloTotal' + '$A2SoloTotal'" />
  3. // which would probably return the values as string
  4. // or
  5. <xsl:value-of select='$A1SoloTotal + $A2SoloTotal'  />
  6. // this should do the computation
The other is how to put this as the sum for an element with blank text value?
I would rather create the whole world-book element in the xsl, then you could loop without condition and copy all book elements
Expand|Select|Wrap|Line Numbers
  1. <xsl:copy-of select="book" />
but there wouldn't be a problem in adding conditions, though.

for the computation, see my previous post

regards

PS: please use [code] tags when posting code
Sep 12 '08 #5
shakilalig
4 New Member
HI Dormilich,
While i was trying to put your idea to my other xml using the xsl , it didn't produce the desired result.
It converted to just the same original XML file. The transformed xml didn't have the added value.
It seems i had made a mistake somewhere . Please advise the change required.
I am stuck for three days.

issue:
abc:TotalMortga gesPrincipalAmo unt Element in the third group should be the sum of MortgagesPrinci palAmount in group 1 and group 2.
group 1 where numericContext@ id = numericABCLevel _1
group 2 where numericContext@ id = numericABCLevel _2


Expand|Select|Wrap|Line Numbers
  1. ****************************CODE*************************************************
  2. test.xml
  3.  
  4. <?xml version="1.0" encoding="UTF-8"?>
  5. <group xmlns="http://www.xbrl.org/2001/instance" xmlns:abc="http://www.abc.com/2001-11-05"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
    <group>
    <numericContext cwa="false" id="numericABCLevel_1" precision="18">
  6. <entity>
  7. <identifier scheme="">88004325080</identifier>
  8. </entity>
  9. </numericContext>
    <abc:CapitalAmount numericContext="numericABCLevel_1">0.0</abc:CapitalAmount>
  10. <abc:PrincipalAmount numericContext="numericABCLevel_1">1445678366.64</abc:PrincipalAmount>
  11. <abc:RiskWeight numericContext="numericABCLevel_1"/>
  12. <abc:WeightedAmount numericContext="numericABCLevel_1"/>
  13.  
  14. <abc:MortgagesPrincipalAmount numericContext="numericABCLevel_1">7.85</abc:MortgagesPrincipalAmount></group>
  15. <group>
    <numericContext  id="numericABCLevel_2" precision="18">
  16. <entity>
  17. <identifier scheme="">88004325081</identifier>
  18. </entity>
  19. </numericContext>
    <abc:CapitalAmount numericContext="numericABCLevel_2">0.0</abc:CapitalAmount>
  20. <abc:PrincipalAmount numericContext="numericABCLevel_2">2445678366.64</abc:PrincipalAmount>
  21. <abc:RiskWeight numericContext="numericABCLevel_2"/>
  22. <abc:WeightedAmount numericContext="numericABCLevel_2"/>
  23.  
  24. <abc:MortgagesPrincipalAmount numericContext="numericABCLevel_2">8.85</abc:MortgagesPrincipalAmount></group>
    <group>
    <numericContext  id="numericABCLevel_0" precision="18">
  25. <entity>
  26. <identifier scheme="">88004325081</identifier>
  27. </entity>
  28. </numericContext>
    <abc:TotalCapitalAmount numericContext="numericABCLevel_0"></abc:CapitalAmount>
  29. <abc:TotalPrincipalAmount numericContext="numericABCLevel_0"></abc:PrincipalAmount>
  30. <abc:TotalRiskWeight numericContext="numericABCLevel_0"/>
  31. <abc:TotalWeightedAmount numericContext="numericABCLevel_0"/>
  32.  
  33. <abc:TotalMortgagesPrincipalAmount numericContext="numericABCLevel_0"></abc:MortgagesPrincipalAmount></group></group>
  34.  
  35. *************************************************************************
  36. test.xsl
  37.  
  38. <?xml version="1.0" encoding="UTF-8"?>
  39. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.xbrl.org/2001/instance" xmlns:abc="http://www.apra.gov.au/statistics/xbrl/2001-11-05"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  40. <xsl:output method="xml" media-type="text/xml" omit-xml-declaration="yes" version="1.0" indent="yes"/>
  41. <xsl:strip-space elements="*"/>
  42.  
  43. <xsl:template match="/ | @* | node()">
  44. <xsl:copy>
  45. <xsl:apply-templates select="@* | node()"/>
  46. </xsl:copy>
  47. </xsl:template>
  48.  
  49. <xsl:template match="group"> 
  50.  
  51.     <xsl:variable name="A1SoloTotal" select="group/abc:MortgagesPrincipalAmount[../descendant::numericContext/@id = 'numericABCLevel_1']"/>
  52.  
  53.     <xsl:variable name="A2SoloTotal" select="group/abc:MortgagesPrincipalAmount[../descendant::numericContext/@id = 'numericABCLevel_2']"/>
  54.  
  55.     <xsl:if test="group/abc:TotalMortgagesPrincipalAmount[../descendant::numericContext/@id = 'numericABCLevel_0']">
  56.      <abc:TotalMortgagesPrincipalAmount><xsl:value-of select="$A1SoloTotal + $A2SoloTotal"/></abc:TotalMortgagesPrincipalAmount>
  57.  
  58.     </xsl:if>
  59.  
  60. </xsl:template> 
  61.  
  62.  
  63. </xsl:stylesheet>
  64.  
  65.  
  66. *********************************************************************************
  67. Desired Result
  68.  
  69. <?xml version="1.0" encoding="UTF-8"?>
  70. <group xmlns="http://www.xbrl.org/2001/instance" xmlns:abc="http://www.abc.com/2001-11-05"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  71. <group>
  72. <numericContext cwa="false" id="numericABCLevel_1" precision="18">
  73. <entity>
  74. <identifier scheme="">88004325080</identifier>
  75. </entity>
  76. </numericContext>
  77.  
  78. <abc:CapitalAmount numericContext="numericABCLevel_1">0.0</abc:CapitalAmount>
  79. <abc:PrincipalAmount numericContext="numericABCLevel_1">1445678366.64</abc:PrincipalAmount>
  80. <abc:RiskWeight numericContext="numericABCLevel_1"/>
  81. <abc:WeightedAmount numericContext="numericABCLevel_1"/>
  82.  
  83. <abc:MortgagesPrincipalAmount numericContext="numericABCLevel_1">7.855722136E9</abc:MortgagesPrincipalAmount>
  84. </group>
  85.  
  86. <group>
  87. <numericContext  id="numericABCLevel_2" precision="18">
  88. <entity>
  89. <identifier scheme="">88004325081</identifier>
  90. </entity>
  91. </numericContext>
  92.  
  93. <abc:CapitalAmount numericContext="numericABCLevel_2">0.0</abc:CapitalAmount>
  94. <abc:PrincipalAmount numericContext="numericABCLevel_2">2445678366.64</abc:PrincipalAmount>
  95. <abc:RiskWeight numericContext="numericABCLevel_2"/>
  96. <abc:WeightedAmount numericContext="numericABCLevel_2"/>
  97.  
  98. <abc:MortgagesPrincipalAmount numericContext="numericABCLevel_2">7.855722136E9</abc:MortgagesPrincipalAmount>
  99. </group>
  100.  
  101. <group>
  102. <numericContext  id="numericABCLevel_0" precision="18">
  103. <entity>
  104. <identifier scheme="">88004325081</identifier>
  105. </entity>
  106. </numericContext>
  107.  
  108. <abc:TotalCapitalAmount numericContext="numericABCLevel_0"></abc:CapitalAmount>
  109. <abc:TotalPrincipalAmount numericContext="numericABCLevel_0"></abc:PrincipalAmount>
  110. <abc:TotalRiskWeight numericContext="numericABCLevel_0"/>
  111. <abc:TotalWeightedAmount numericContext="numericABCLevel_0"/>
  112.  
  113. <abc:TotalMortgagesPrincipalAmount numericContext="numericABCLevel_0">16.7</abc:MortgagesPrincipalAmount>
  114. </group>
  115. </group>
  116.  
  117.  
  118. *****************************************************************************
oops, missed your first reply while posting #4


this is because there's a syntax error. it is
Expand|Select|Wrap|Line Numbers
  1. // either
  2. <xsl:value-of select="'$A1SoloTotal' + '$A2SoloTotal'" />
  3. // which would probably return the values as string
  4. // or
  5. <xsl:value-of select='$A1SoloTotal + $A2SoloTotal'  />
  6. // this should do the computation
I would rather create the whole world-book element in the xsl, then you could loop without condition and copy all book elements
Expand|Select|Wrap|Line Numbers
  1. <xsl:copy-of select="book" />
but there wouldn't be a problem in adding conditions, though.

for the computation, see my previous post

regards

PS: please use [code] tags when posting code
Sep 22 '08 #6
Dormilich
8,658 Recognized Expert Moderator Expert
HI Dormilich,
While i was trying to put your idea to my other xml using the xsl , it didn't produce the desired result.
It converted to just the same original XML file. The transformed xml didn't have the added value.
It seems i had made a mistake somewhere . Please advise the change required.
I am stuck for three days.
problem 1: you don't use [code] tags (this makes the code hard to read)
problem 2: you already copy all the nodes in the first template
problem 3: I'm just before going home, I'll look into it tomorrow

regards
Sep 22 '08 #7
shakilalig
4 New Member
problem 1: you don't use [code] tags (this makes the code hard to read)
problem 2: you already copy all the nodes in the first template
problem 3: I'm just before going home, I'll look into it tomorrow

regards
Sorry Dormilich, I missed to put the Code tag in other two files. I had put in the first one. Please look into it and advise the remedy.
Sep 23 '08 #8
Dormilich
8,658 Recognized Expert Moderator Expert
geez, that was givin me the creeps....

problem 1: have a look at your xml, it's not well-formed (though that's a minor problem and easily fixed)

problem2: <xsl:copy-of> didn't work.... until I inserted an additional namespace prefix with the default namespace

note: I'd rename the root node to prevent confusions

solution principle

Expand|Select|Wrap|Line Numbers
  1. // this is not valid code!
  2. <xsl:template match="/">
  3.    <xsl:copy-of/> // all nodes except numericABCLevel_0
  4.    <xsl:call-template/> // numericABCLevel_0
  5. </xsl:template>
  6.  
  7. <xsl:template>
  8.    <xsl:copy-of/> // all nodes except TotalMortgagesPrincipalAmount
  9.    <xsl:value-of/> // TotalMortgagesPrincipalAmount
  10. </xsl:template>
if you want to try a bit for yourself, this is the "header" I used (you need not sticking with 'inp' as prefix, choose one to your liking):
Expand|Select|Wrap|Line Numbers
  1. <xsl:stylesheet version="1.0" 
  2.    xmlns="http://www.xbrl.org/2001/instance" 
  3.    xmlns:inp="http://www.xbrl.org/2001/instance" 
  4.    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  5.    xmlns:abc="http://www.apra.gov.au/statistics/xbrl/2001-11-05" 
  6.    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  7.  
  8. //inp:group <!-- these are the group elements now -->
note: I somehow had problems getting the values

full solution in the next post, because I'll be on vacation for a week

regards
Sep 23 '08 #9
Dormilich
8,658 Recognized Expert Moderator Expert
please use this solution only when you have problems with the code (well, at least try, ok?)

note: maybe some of the XPaths can be simplified in your environment
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0" 
  3. xmlns="http://www.xbrl.org/2001/instance" 
  4. xmlns:inp="http://www.xbrl.org/2001/instance" 
  5. xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  6. xmlns:abc="http://www.apra.gov.au/statistics/xbrl/2001-11-05" 
  7. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  8. <xsl:output method="xml" indent="yes"/>
  9.  
  10. <xsl:template match="/">
  11. <group>
  12.     <xsl:copy-of select="//inp:group[descendant::inp:numericContext/@id != 'numericABCLevel_0']" />
  13.     <xsl:call-template name="g1" />
  14. </group>
  15. </xsl:template>
  16.  
  17. <xsl:template name="g1">
  18.     <xsl:variable name="A1SoloTotal" select="//inp:group/*[name() = 'abc:MortgagesPrincipalAmount'][@numericContext = 'numericABCLevel_1']"/>
  19.     <xsl:variable name="A2SoloTotal" select="//inp:group/*[name() = 'abc:MortgagesPrincipalAmount'][@numericContext = 'numericABCLevel_2']"/>
  20.     <group>
  21.         <xsl:copy-of select="//inp:group/*[local-name() != 'TotalMortgagesPrincipalAmount'][../inp:numericContext/@id = 'numericABCLevel_0']"/>
  22.     <abc:TotalMortgagesPrincipalAmount><xsl:value-of select="$A1SoloTotal + $A2SoloTotal"/></abc:TotalMortgagesPrincipalAmount>
  23.     </group>
  24. </xsl:template>
  25.  
  26. </xsl:stylesheet>
Sep 23 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2713
by: Sergio del Amo | last post by:
Hi, I use the xslt functions provided by php. I am running in my computer the package xampp(www.apachefriends.org) which includes php/apache/mysql .. In this package the php includes the sablotron extension responsible for the xslt functions. The problem i have is that the obtained transformation is not the waited one. I try to proccess the same XML file with XSL file with a program called XMLspy and i obtained the desire and waited...
3
7929
by: pradeep gummi | last post by:
I have an XML FILE that is to be converted to Plain Text using an XSL file. Since I just want plain text, I do not want to set any root element during transformation.And if I do not any root element during transformation, it return s "java.lang.IllegalStateException: Root element not set" exception. If I add any element for the enclosed root, it works. Note: I am using XMLOutputter object of JDOM API, packages javax.xml.transform and...
7
3248
by: CK | last post by:
Hello, I have the 60 MB XML string and I am coding a program in Visual Basic to run a XSL transformation on it. Currently, I'm using the Microsoft standard MSXML 2.0 to create a DOM document, load the XML, and then run the XSL transformation on it using the MSXML2.IXSLProcessor interface. The problem is that it kills my system because of an incredible amount of memory that it requires to do this (around 850 MB). Are there any other...
8
2370
by: Will | last post by:
I was thrust into XML about 2 weeks ago and don't know much yet. From another department in the corp I am receiving an XML file which concatenates nodes all on one line i.e. <car><make>ford</make><color>red</color><year>2001</year></car><car><make><mb> etc. etc. etc. Some lines are over 300 characters long. I need to translate this spagetti XML into something which is humanly readable. I probably need to use XSL however I'm not sure...
0
1382
by: pulvertum | last post by:
Hello, I need an org.w3c.dom.Document so I can pass them to do a transformation of my XML using XSL (to another XML as result). I've tried several solutions but didn't have the desired result: SOLUTION 1 using StreamOutput: StreamSource streamXSL = new StreamSource(new File(txtFileXSL));
6
4546
by: Jain, Pranay Kumar | last post by:
Hi All, We have created a simple application that takes a dataset and generates the data in Excel schema format. It uses an xslt file to do the transformation for excel 2002 and so on. We are using the dotnet.xml resource and not the MSXML 4. The application is golden and works fine with realtively Medium size of data(around 25MB). We started to see issues if the data is greater then 25 MB where the transformation takes tooo long and...
2
1794
by: TomekR | last post by:
Hello ! I was developing xslt sheet lately and - experimenting - I made mistake resulting in that, the effect of the transformation is not well-formed xml document. I made these tests using XmlSpy and in output window I can see two parallel elements - according to "logic" of me sheet. The error of that document is that it doesn't have root element. Here is the contents of XmlSpy output window:
14
9110
by: Thomas Bauer | last post by:
Hello, I search a example like that. (1,0,0,1,4,5 ) -- moving (1,0,0,1,0,0 ) -- normal matrix (-1,0,0,1,0,0 ) -- Mirror Y-Axis (0,-1,0,1,0,0 ) -- Mirror X-Axis I caluculate all in mm.
2
4078
MarkoKlacar
by: MarkoKlacar | last post by:
Hi, My problem is the following: I've got an XSL transformation, not written by me, and I've got a while bunch of XML files that need to be transformed using the transformation. Now the script seems to read the files using URLs specified in the XSL script, and output the somehow. Is there a way to just "call" the XSL transformation without any input files?
0
1336
by: Amit00 | last post by:
Hi, I'm performing an xsl transformation in a page I built, and would like to use some custom controls in it (or asp controls, for that matter). I looked this issue up, and understood that it can be done by adding the attribute "xmlns:tagname="remove"" to the "xsl:stylesheet" node, then performing the transformation, removing that attribute from the resulting html string, and then creating a control using "ParseControl(strHtml)" and adding...
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9588
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10327
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3828
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2999
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.