Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2010, 10:31 AM
Authorized User
 
Join Date: Mar 2010
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
Default Problem with namespace

Hi,

i have small problem,

below is my expected xml o/p

Code:
<dokument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="universal.xsd">	
  <hlavicka>		
    <identifikacneCislo>			
      <kodStatu/>			
      <dic>xyz</dic>		
    </identifikacneCislo>		
  </hlavicka>	
  <telo>
  	<strana>		
      <oznacenie>				
        <aktualna>1</aktualna>				
        <celkovo>2</celkovo>			
      </oznacenie>		
    </strana>
	<strana>		
      <oznacenie>				
        <aktualna>3</aktualna>				
        <celkovo>4</celkovo>			
      </oznacenie>	
    </strana>
  </telo>
</dokument>
my xml o/p should start with <dokument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="universal.xsd">
and should end with </dokument>

in my xsl i mentioned like below

Code:
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<dokument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="universal.xsd">
<xsl:apply-templates select="/ZXXEUSL" mode="temp1"/> 
</dokument>	
</xsl:template>
<xsl:template match="ZXXEUSL" mode="temp1">
...some logic..
</xsl:template>
</xsl:stylesheet>
but when iam trying to apply it in apps it is saying invalid xsl file..

Kindly suggest how i can get my expected xml o/p

Thanks
Anil
 
Old June 9th, 2010, 10:49 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Well there is nothing wrong with the XSL file that you have shown us, so the problem must be in what you haven't shown us.

Perhaps you could try using a different XSLT processor that might give you a better error - try downloading Kernow for Saxon which I find gives very helpful error messages.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?





Similar Threads
Thread Thread Starter Forum Replies Last Post
error CS0234: The type or namespace name 'Xml' does not exist in the namespace 'Syste shailesh_kumar C# 2008 aka C# 3.0 8 August 20th, 2009 03:11 AM
Need to convert an existing namespace and add new namespace to the SOAP xml Prabeen XSLT 10 April 28th, 2009 10:18 AM
namespace problem gantait XSLT 5 February 19th, 2007 12:51 AM
namespace problem olambe BOOK: ASP.NET Website Programming Problem-Design-Solution 3 May 21st, 2004 12:08 PM
namespace problem marclena XSLT 1 February 12th, 2004 03:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.