The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[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>&nbsp;</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>&nbsp;</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"&nbsp;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">"&nbsp;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">">&nbsp;<xsl:template
match="/" >&nbsp;&nbsp;<xsl:element
name="xap:message">&nbsp;&nbsp;&nbsp;<!-- copy
the header unchanged -->&nbsp;&nbsp;&nbsp;<xsl:copy-of
select="xap:message/xap:header"/>&nbsp;&nbsp;&nbsp;<!--
rewrite each block -->&nbsp;&nbsp;&nbsp;<xsl:for-each
select="xap:message/xap:block">&nbsp;&nbsp;&nbsp;&nbsp;<xsl:element
name="xap:block">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--
add '.enhanced' to the end of the block name attribute
-->&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<xsl:attribute
name="name"><xsl:value-of
select="@name"/>.enhanced</xsl:attribute>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--
copy the command item unchanged
-->&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<xsl:copy-of
sele
ct="xap:item[@name='command']"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--
rewrite the device item mapping unit to named device
-->&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<xsl:if
test="xap:item[@name='device'] =
'E1'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<xap:item
name="device">LivingRoom</xap:item>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</xsl:if>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<xsl:if
test="xap:item[@name='device'] =
'C4'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<xap:item
name="device">Study</xap:item>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</xsl:if>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:element>&nbsp;&nbsp;&nbsp;</xsl:for-each>&nbsp;&nbsp;</xsl:element>&nbsp;</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

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.