[Message Prev][Message
Next][Thread Prev][Thread Next][Message
Index][Thread Index]
RE: xAP and XML
- Subject: RE: xAP and XML
- From: Edward Pearson
- Date: Thu, 18 Mar 2004 00:40:00 +0000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
<TITLE>Message</TITLE>
<DIV><SPAN class="052225523-17032004"><FONT
face="Arial" color="#0000ff"
size="2">Below isn't the example you ask for, it's one I tried
at the weekend but it'd be a starting
point.</FONT></SPAN></DIV>
<DIV><SPAN class="052225523-17032004"><FONT
face="Arial" color="#0000ff"
size="2"></FONT></SPAN> </DIV>
<DIV><SPAN class="052225523-17032004"><FONT
face="Arial" color="#0000ff" size="2">It
take a (notional) X10 message; appends '.enhanced' to all the block names
in it and maps a couple of X10 device codes to named devices (C4 ->
Study and E1 -> LivingRoom).</FONT></SPAN></DIV>
<DIV><SPAN class="052225523-17032004"><FONT
face="Arial" color="#0000ff"
size="2"></FONT></SPAN> </DIV>
<DIV><SPAN class="052225523-17032004"><FONT
color="#0000ff"><FONT face="Courier New"
size="2"><?xml version="1.0"
encoding="utf-8" ?> <xsl:stylesheet
version="1.0" xmlns:xsl="</FONT><A
href="http://www.w3.org/1999/XSL/Transform"><FONT
face="Courier New" size="2">http://www.w3.org/1999/XSL/Transform</FONT></A><FONT
face="Courier New"
size="2">" xmlns:xap="</FONT><A
href="http://www.xapautomation.org/schema/12"><FONT
face="Courier New" size="2">http://www.xapautomation.org/schema/12</FONT></A><FONT
face="Cou
rier New" size="2">"> <xsl:template
match="/" > <xsl:element
name="xap:message"> <!-- copy
the header unchanged --> <xsl:copy-of
select="xap:message/xap:header"/> <!--
rewrite each block --> <xsl:for-each
select="xap:message/xap:block"> <xsl:element
name="xap:block"> <!--
add '.enhanced' to the end of the block name attribute
--> <xsl:attribute
name="name"><xsl:value-of
select="@name"/>.enhanced</xsl:attribute> <!--
copy the command item unchanged
--> <xsl:copy-of
sele
ct="xap:item[@name='command']"/> <!--
rewrite the device item mapping unit to named device
--> <xsl:if
test="xap:item[@name='device'] =
'E1'"> <xap:item
name="device">LivingRoom</xap:item> </xsl:if> <xsl:if
test="xap:item[@name='device'] =
'C4'"> <xap:item
name="device">Study</xap:item> </xsl:if> </xsl:element> </xsl:for-each> </xsl:element> </xsl:template></xsl:stylesheet></FONT></FONT></SPAN></DIV>
<BLOCKQUOTE>
<DIV></DIV>
<DIV class="OutlookMessageHeader" lang="en-us"
dir="ltr" align="left"><FONT
face="Tahoma" size="2">-----Original
Message-----<B>From:</B> Mark Harrison (Yahoo!) [mailto:mph@xxxxxxx] <B>Sent:</B>
17 March 2004 20:43<B>To:</B>
xAP_developer@xxxxxxx<B>Subject:</B> Re: [xAP_developer] xAP
and XML</FONT></DIV><TT>Patrick,How complex would it be
to write an XSLT document that basically did thefollowing?--- On incoming
call from number XXXX--- Send mute command to the hifiAm I right in
thinking that it's a simple XSLT document?M.----- Original Message -----
From: "Patrick Lidstone (Personal E-mail)"
<patrick@xxxxxxx>To: <xAP_developer@xxxxxxx>Sent: Wednesday,
March 17, 2004 2:44 PMSubject: [xAP_developer] xAP and XML</TT>
xAP_Development Main Index |
xAP_Development Thread Index |
xAP_Development Home |
Archives Home
|