| From | Sent On | Attachments |
|---|---|---|
| Murray, Bryan P. | Apr 26, 2005 6:29 pm | |
| Tom Maguire | Apr 27, 2005 5:39 am | |
| Peter Niblett | May 8, 2005 3:11 pm |
| Subject: | RE: [wsn] Transform for TopicSpace to instance xml | |
|---|---|---|
| From: | Peter Niblett (pete...@uk.ibm.com) | |
| Date: | May 8, 2005 3:11:21 pm | |
| List: | org.oasis-open.lists.wsn | |
Bryan
Thanks for doing this update. I'll incorporate this into the proposal for WSN 4.2. However I notice that we say the wstop:TopicSpace/@name is optional, so I think we will need to use something else for the root element of the transformed document - in the first attempt at the proposal I used tns:TopicSpaceRoot. I don't think it really matters what this node is called - it isn't a Topic so isn't something that needs to be returned by a TopicExpression.
Regards
Peter Niblett IBM Senior Technical Staff Member
"Murray, Bryan P." <bryan.murray@hp. To com> "Tom Maguire" <tmag...@us.ibm.com>, 27/04/2005 02:30 <ws...@lists.oasis-open.org> cc
Subject RE: [wsn] Transform for TopicSpace to instance xml
Tom,
My understanding of the purpose of the transform was to transform a TopicSpace document into a document on which the WS-Topics FullPath expression operates. When I run the MUWS topic space document ( http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2-events.xml) through your XSL doc, I don't get what I expect.
I have created an alternate XSL doc:
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wstop=" http://docs.oasis-open.org/wsn/2004/06/wsn-WS-Topics-1.2-draft-01.xsd" version="1.0">
<xsl:output method="xml" indent="yes" encoding="utf-8" omit-xml-declaration="yes"/>
<xsl:variable name="tns"><xsl:value-of select="/wstop:TopicSpace/@targetNamespace"/></xsl:variable>
<xsl:template match="/wstop:TopicSpace"> <xsl:element name="ns:{@name}" namespace="{$tns}"> <xsl:apply-templates/> </xsl:element> </xsl:template>
<xsl:template match="wstop:Topic"> <xsl:element name="{@name}"> <xsl:apply-templates/> </xsl:element> </xsl:template>
<xsl:template match="/wstop:TopicSpace/wstop:Topic"> <xsl:element name="ns:{@name}" namespace="{$tns}"> <xsl:apply-templates/> </xsl:element> </xsl:template>
<xsl:template match='text()'/>
</xsl:stylesheet>
With the following output:
<ns:MuwsNotificationTopics xmlns:ns=" http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2-events.xml"> <ns:IdentityCapability> </ns:IdentityCapability> <ns:ManageabilityCharacteristicsCapability> </ns:ManageabilityCharacteristicsCapability> <ns:CorrelatablePropertiesCapability> </ns:CorrelatablePropertiesCapability> <ns:DescriptionCapability> </ns:DescriptionCapability> <ns:StateCapability> </ns:StateCapability> <ns:OperationalStatusCapability> </ns:OperationalStatusCapability> <ns:MetricsCapability> </ns:MetricsCapability> <ns:ConfigurationCapability> </ns:ConfigurationCapability> <ns:RelationshipsCapability> <RelationshipCreated> </RelationshipCreated> <RelationshipDeleted> </RelationshipDeleted> </ns:RelationshipsCapability> <ns:RelationshipAccessCapability> </ns:RelationshipAccessCapability> <ns:RelationshipResourceCapability> </ns:RelationshipResourceCapability> <ns:ManageabilityEndpointCreation> <ManageableResourceCreation> </ManageableResourceCreation> </ns:ManageabilityEndpointCreation> <ns:ManageabilityEndpointDestruction> <ManageableResourceDestruction> </ManageableResourceDestruction> </ns:ManageabilityEndpointDestruction> </ns:MuwsNotificationTopics>
The resulting transformed document is what I was picturing. WS-Topics will need to make it clear that an expression such as "ns:RelationshipsCapability/*" does not indicate the root element of the transformed document.
Bryan
-----Original Message----- From: Tom Maguire [mailto:tmag...@us.ibm.com] Sent: Monday, April 25, 2005 8:56 AM To: ws...@lists.oasis-open.org Subject: [wsn] Transform for TopicSpace to instance xml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xsd">
<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="xsd:*"/>
<xsl:template match = 'xsd:schema/xsd:element' > <xsl:element name= "{@name}" > <xsl:apply-templates select='xsd:complexType' mode="recur" /> </xsl:element> </xsl:template>
<xsl:template match = 'xsd:complexType' mode="recur" > <xsl:apply-templates select='*/xsd:element' mode="recur" /> </xsl:template>
<xsl:template match = 'xsd:element' mode="recur" > <xsl:element name= "{@name}" > <xsl:apply-templates select='xsd:complexType' mode="recur" /> </xsl:element> </xsl:template>
</xsl:stylesheet>
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. - Antoine de Saint-Exupery
T o m M a g u i r e
STSM, On Demand Architecture
Poughkeepsie, NY 12601





