[XML-SIG] XML/python approach to "smooshing docs together"?
Mike Olson
Mike.Olson@fourthought.com
Sun, 12 Nov 2000 12:30:36 -0700
"Thomas B. Passin" wrote:
>
> Will Partain asks -
>
> >
> > How might you define, precisely, such a "smooshing
> together"
> > system?
> >
> > * How do you "line up" the transparencies so you can look
> at
> > them?
> >
> > * Say you have 10 transparencies... in what order do you
> do
> > the pair-wise "smooshing"?
> >
>
> Don't think about layers "winning". Use XML to tell you
> what each layer really is. In your example, wrap each of
> the three "layers" in its own wrapper:
>
> <site-admin>
> <host-specific>
> <host>
> <name>slicker</name>
> <ip-address>221.170.160.25</ip-address>
> </host>
>
> <host><!-- More hosts listed here --></host>
> </host-specific>
>
> <site-common>
> <filesystem>
> <mount-point>/</mount-point>
> <size>84MB</size>
> </filesystem>
> <filesystem>
> <mount-point>/usr/local</mount-point>
> <size>128MB</size>
> </filesystem>
> </site-common>
>
> <platform-common>
> <platform type='Sun'>
> <programs>
> <pgm name="DIFF" path="/usr/bin/diff" />
> <pgm name="MAKE" path="/usr/ccs/bin/make" />
> </programs>
> </platform>
> <platform-specific>
> </site-admin>
>
> This do what you want? The other issues sound non-xml-ish.
> E.g.,
If your finally UI is HTML, then you could use XSLT to "smoosh" the data
and dislpay it. It would be a pretty simple tranform depending on how
complex you rules are to combin.
<xsl:template match="site-admin/host-specific">
<H1><xsl:value-of select="name"/></H1>
<B>IP Address:</B><xsl:value-of select="ip-address"/>
<!--add common-->
<xsl:apply-templates select="/site-admin/site-common"/>
<!--Add platform common-->
<xsl:apply-templates select="/site-admin/platform-specific"/>
</xsl:template>
<xsl:template match="site-common">
<!-- left as user exercise -->
</xsl:template>
<xsl:template match="platform-specific">
<!-- left as user exercise -->
</xsl:template>
You can also add logic to not display things that have been "overridden"
at higher level.
Mike
>
> > * Say you have 10 transparencies... in what order do you
> do
> > the pair-wise "smooshing"?
> >
>
> Depends on what you want to do it for ... sounds like a user
> interface issue (that makes it the hardest kind!).
>
> Cheers,
>
> Tom Passin
>
> _______________________________________________
> XML-SIG maillist - XML-SIG@python.org
> http://www.python.org/mailman/listinfo/xml-sig
--
Mike Olson Principal Consultant
mike.olson@fourthought.com (303)583-9900 x 102
Fourthought, Inc. http://Fourthought.com
Software-engineering, knowledge-management, XML, CORBA, Linux, Python