Guest User

Untitled

a guest
Nov 15th, 2012
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Schedule xmlns="http://www.xxx.com/12022012/schedule/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xxx.com/12022012/schedule/v2 ../Schema/Schema_v2.xsd">
  3. <Interface_Header>
  4. </Interface_Header>
  5. ...
  6. </Schedule>
  7.  
  8. <xsl:stylesheet version="1.0"
  9. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  10. <xsl:output omit-xml-declaration="yes" indent="yes"/>
  11.  
  12. <xsl:template match="node()|@*">
  13. <xsl:copy>
  14. <xsl:apply-templates select="node()|@*"/>
  15. </xsl:copy>
  16. </xsl:template>
  17. </xsl:stylesheet>
  18.  
  19. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  20. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  21. xmlns:ns="new_namespace">
  22. <xsl:output method="xml" indent="yes"/>
  23.  
  24. <xsl:template match="@xsi:schemaLocation">
  25. <xsl:attribute name="xsi:schemaLocation">
  26. <xsl:text>new_schema_location</xsl:text>
  27. </xsl:attribute>
  28. </xsl:template>
  29.  
  30. <xsl:template match="node() | @*">
  31. <xsl:copy>
  32. <xsl:apply-templates select="node() | @*"/>
  33. </xsl:copy>
  34. </xsl:template>
  35.  
  36. <xsl:template match="*">
  37. <xsl:element name="{local-name()}" namespace="ns">
  38. <xsl:apply-templates select="node() | @*"/>
  39. </xsl:element>
  40. </xsl:template>
  41.  
  42. </xsl:stylesheet>
  43.  
  44. <Schedule xsi:schemaLocation="new_schema_location" xmlns="ns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  45. <Interface_Header>
  46. </Interface_Header>
  47. ...
  48. </Schedule>
  49.  
  50. <xsl:output indent="yes" method="xml"/>
  51.  
  52. <xsl:template match="/">
  53. <xsl:apply-templates select="node()|@*"/>
  54. </xsl:template>
  55.  
  56. <xsl:template match="node()|@*">
  57. <xsl:copy>
  58. <xsl:apply-templates select="node()|@*"/>
  59. </xsl:copy>
  60. </xsl:template>
  61.  
  62. <xsl:template match="@*[local-name() = 'schemaLocation']">
  63. <xsl:attribute name="schemaLocation">newSchemaLocation</xsl:attribute>
  64. </xsl:template>
  65.  
  66. <xsl:stylesheet
  67. version="1.0"
  68. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  69. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  70.  
  71. ...
  72.  
  73. <xsl:template match="@*[name() = 'xsi:schemaLocation']">
  74. <xsl:attribute name="xsi:schemaLocation">newSchemaLocation</xsl:attribute>
  75. </xsl:template>
  76.  
  77. </xsl:stylesheet>
Add Comment
Please, Sign In to add comment