XML Style-sheet question

Christopher chris_mk at hotmail.com
Mon Jul 22 18:58:21 EDT 2002


Hey everybody,

I am working on implementing a Python program to interface with
FileMaker 6 and I had a question.  The ability to use XML Stylesheets
is very nice with the new FileMaker version, but I've run into a bit
of a problem (I am in the middle of learning XML and all that entails
but I am oblivious to some of the details).

Here's the issue:  I know that I can create an export protocol and run
it through XML stylesheets to put things into columns with headings
(in Excel; in other words, the XML formats the data and Excel can read
that formatting).  What I want to know is if there is a way to design
a stylesheet template so that even custom exports are formatted
correctly.  Let me give a brief example (I know everybody is quite
busy).

Let's say you have a product database and each product has a unique
product number.  Each product also has a color, a price, a shipping
price, a profit margin, etc.  Now, I made an export (and stylesheet)
that takes each of the products, makes a column with the product
number as the heading and lists the color, price, and profit.

Now, other people will have access to the database and they, too, want
to have the exports formatted with the product number on top of each
column.  Now, there are about 100 characteristics for each product, so
making a separate stylesheet for each possibility is pretty much
impossible (100! (that is 100 * 99 * 98...) + possibilities, right). 
Is there a way to automate it somehow?  If there isn't, can you tell
me that too, so I'll just break the bad news to my coworkers.

Thanks.

Chris

PS- As a side-note, I am thinking of trying a python script similiar
to the Article Handler from Python & XML (something like

if name == "webArticle":
            subcat = attrs.get("subcategory", "")
            if subcat.find("tech") > -1:
                self.inArticle = 1
                self.isMatch = 1

        elif self.inArticle:
            if name == "header":
                self.title = attrs.get("title", "")
            if name == "body":
                self.inBody = 1

but this is quite advanced for me at the moment, so I am trying to do
the simplest, quickest, and most user-friendly manner possible. 
Thanks again.



More information about the Python-list mailing list