[XSLT] For-Each incluant des namespace
Bonjour à tous,
Cela fait maintenant un petit moment que j'essaie de créer une feuille XSLT, mais je me perds avec les namespace et les requete XPath.
Voici donc mon fichier XML source :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetGroupCollectionFromSiteResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">
<GetGroupCollectionFromSiteResult>
<GetGroupCollectionFromSite>
<Groups>
<Group ID="5" Name="Collection1 Members" Description="Use this group to give people contribute permissions to the SharePoint site: Collection1" OwnerID="3" OwnerIsUser="False" />
<Group ID="3" Name="Collection1 Owners" Description="Use this group to give people full control permissions to the SharePoint site: Collection1" OwnerID="3" OwnerIsUser="False" />
<Group ID="4" Name="Collection1 Visitors" Description="Use this group to give people read permissions to the SharePoint site: Collection1" OwnerID="3" OwnerIsUser="False" />
</Groups>
</GetGroupCollectionFromSite>
</GetGroupCollectionFromSiteResult>
</GetGroupCollectionFromSiteResponse>
</soap:Body>
</soap:Envelope> |
Voici ce que je voudrai obtenir :
Code:
1 2 3 4 5 6
|
<Segments>
<Segment Title="Collection1 Members" Value="5" />
<Segment Title="Collection1 Owners" Value="3" />
<Segment Title="Collection1 Visitors" Value="4" />
</Segments> |
Malheureusement, entre les multiples namespace et les requêtes XPath associées je ne m'en sort pas.
Voici mon avancée dans ma feuille XSLT :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:group="http://schemas.microsoft.com/sharepoint/soap/directory/">
<xsl:output method="xml" version="1.0" omit-xml-declaration="yes" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<Segments>
<xsl:for-each select="/soap:Enveloppe/soap:Body/group:GetGroupCollectionFromSiteResponse/group:GetGroupCollectionFromSiteResult/group:GetGroupCollectionFromSite/group:Groups/group:Group">
<Segment />
</xsl:for-each>
</Segments>
</xsl:template>
</xsl:stylesheet> |
Et j'obtiens cela :
Code:
1 2
|
<Segments xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:group="http://schemas.microsoft.com/sharepoint/soap/directory/" /> |
Je souhaiterai donc obtenir ma structure XML cité ci-dessus.
Pouvez-vous m'aider à obtenir cela ?
Serait-il possible aussi d'obtenir au final une structure XML sans les namespace comme juste au-dessus ?
Merci par avance,
Guillaume.