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 14th, 2007, 03:52 AM
Registered User
 
Join Date: May 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default help, basic xslt

Hi,

I have a XML file who starts like this:

Code:
<StateMachineWorkflowActivity x:Class = "ReviewWorkflows.ReviewWF"
                        x:Name = "ReviewWF" DynamicUpdateCondition = "{x:Null}" 
                        xmlns:ns0 = "clr-namespace:ReviewWorkflows" xmlns:x = "http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/workflow">


.....

</StateMachineWorkflowActivity>



and when i apply my XSLT:

Code:
<xsl:template match="/">
   <xsl:value-of select ="vt:initCount()"/>
    <Root>
      <xsl:apply-templates select="StateMachineWorkflowActivity/StateActivity" mode="sa"/> 
    </Root>    
  </xsl:template>

  <xsl:template match="StateActivity" mode="sa"> 

....
i never match the node StateMachineWorkflowActivity!!!

but if i edit my orignal file and remove the StateMachineWorkflowActivity attributes, i have no problem!!

Code:
<StateMachineWorkflowActivity>
...
</tateMachineWorkflowActivity>
Thank's a lot

 
Old June 14th, 2007, 05:30 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Please see the first "sticky" post in this forum which contains advice on matching names in a default namespace.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old June 18th, 2007, 11:10 AM
Registered User
 
Join Date: May 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Michael,

I already read the "sticky" post, and i identify the problem with the points 23 and 26 but i do not have resolve my problem yet!

this is my XML: (in the truth it´s a Windows Workflow Foundation XOML file)


<StateMachineWorkflowActivity x:Class = "ReviewWorkflows.ReviewWF" InitialStateName = "ReviewState"
                        x:Name = "ReviewWF" DynamicUpdateCondition = "{x:Null}" CompletedStateName = "EndReviewState"
                        xmlns:ns0 = "clr-namespace:ReviewWorkflows" xmlns:x = "http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/workflow">

...

</StateMachineWorkflowActivity>


Now i have tried transform him with:

<xsl:template match="/">
   <Root>
      <xsl:apply-templates select="x:StateMachineWorkflowActivity/StateActivity" mode="sa"/>
    </Root>
  </xsl:template>

but don´t match!!!!

if i try to remove the namespaces in the XOML file, it works perfectly.

what´s wrong???

Thank´s for your patience

 
Old June 18th, 2007, 11:14 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You've added a prefix to StateMachineWorkflowActivity but you haven't added it to StateActivity, which is also in the same namespace.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old June 19th, 2007, 06:45 AM
Registered User
 
Join Date: May 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It works Thank's






Similar Threads
Thread Thread Starter Forum Replies Last Post
Can XSLT read DTD/schema and Generate XSLT.. ROCXY XSLT 1 November 6th, 2006 09:39 AM
dynamic xslt -> xslt creation namespace problem jkmyoung XSLT 2 July 15th, 2006 12:42 AM
xslt basic question kgoldvas XSLT 2 January 25th, 2006 02:48 PM
basic xslt Question abhishek verma XSLT 4 January 24th, 2006 05:35 AM
Basic XSLT problem.... johrik XSLT 2 February 6th, 2004 09:13 AM





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