Any suggestions CSS/XML

I have an interesting implementation and I am trying to kill two birds with
one stone.  In the wizard I am designing the user has the ability to choose
from one of n CSS style sheets to be applied to the end results of the
wizard.  I am also thinking of supporting customization of the stylesheet
and this is where my question comes in.  I have been commenting my
stylesheets using xml as a guide, for example

<data>
    <name>Cool Blue</name>
    <comment>yadda</comment>
    <styleset name="common">
        <styles>
            <style name="gridTitle">This style is used to etc...</style>
            <style name="gridBody">this style is....</style>
        </styles>
        <raw>
        dummy{}
        .gridTitle{font-size:10pt;color:red}
        .gridBody{fonts-size:8pt;color:black}
        </raw>
    </styleset>
    ...more styleset nodes
</data>


You will notice that the actual styles are contained in the node raw. I have
found that if a create a dummy() empty style the following styles are
correctly picked up by the css parser on all modern browsers!!

So even though this xml/css crossbreed seems to work I wonder if there is a
set way of doing this that I am unaware of.   I have done some research but
have not found anything so though I would ask all you smart people.

Cheers
Keith


0
kchadwick (26)
12/7/2003 6:08:49 PM
dotnet.xml 7266 articles. 0 followers. Follow

4 Replies
625 Views

Similar Articles

[PageSpeed] 0


Keith Chadwick wrote:

> I have an interesting implementation and I am trying to kill two birds with
> one stone.  In the wizard I am designing the user has the ability to choose
> from one of n CSS style sheets to be applied to the end results of the
> wizard.  I am also thinking of supporting customization of the stylesheet
> and this is where my question comes in.  I have been commenting my
> stylesheets using xml as a guide, for example
> 
> <data>
>     <name>Cool Blue</name>
>     <comment>yadda</comment>
>     <styleset name="common">
>         <styles>
>             <style name="gridTitle">This style is used to etc...</style>
>             <style name="gridBody">this style is....</style>
>         </styles>
>         <raw>
>         dummy{}
>         .gridTitle{font-size:10pt;color:red}
>         .gridBody{fonts-size:8pt;color:black}
>         </raw>
>     </styleset>
>     ...more styleset nodes
> </data>
> 
> 
> You will notice that the actual styles are contained in the node raw. I have
> found that if a create a dummy() empty style the following styles are
> correctly picked up by the css parser on all modern browsers!!
> 
> So even though this xml/css crossbreed seems to work I wonder if there is a
> set way of doing this that I am unaware of.   I have done some research but
> have not found anything so though I would ask all you smart people.

I am not sure what you gain with the XML commenting and containing CSS 
style rules as CSS has a syntax for comments but if you want to serve 
the style rules to a browser as a text/css stylesheet then I strongly 
suggest to use XSLT to extract them and to send only them to the browser.
That allows you to store the meta data you want to store with a style 
sheet but also lets browsers only deal with what their CSS parsers are 
supposed to deal with.

BTW: fonts-size is not the correct CSS property name.

-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/

0
12/8/2003 11:53:15 AM
As I stated I am trying to kill to birds with one stone.  I have checked
across several several different browsers and down level browsers as well
and there appears to be no problem with any of the browsers picking up the
CSS.

It was just an idea to try out and was curious as to feedback.

Regards
Keith

> I am not sure what you gain with the XML commenting and containing CSS
> style rules as CSS has a syntax for comments but if you want to serve
> the style rules to a browser as a text/css stylesheet then I strongly
> suggest to use XSLT to extract them and to send only them to the browser.
> That allows you to store the meta data you want to store with a style
> sheet but also lets browsers only deal with what their CSS parsers are
> supposed to deal with.
>
> BTW: fonts-size is not the correct CSS property name.
>
> -- 
>
> Martin Honnen
> http://JavaScript.FAQTs.com/
>


0
chady (6)
12/8/2003 3:26:38 PM

Keith Chadwick wrote:

> As I stated I am trying to kill to birds with one stone.  I have checked
> across several several different browsers and down level browsers as well
> and there appears to be no problem with any of the browsers picking up the
> CSS.
> 

The CSS validator at
http://jigsaw.w3.org/css-validator/validator-text.html
will tell you that most of that example is unrecognized.
Even if the browsers can cope with your CSS in XML I don't think you 
should send more to a browser than is needed and force them to try to 
parse the XML as CSS if there are techniques like XSLT which would allow 
you to extract the CSS rules from the the XML and just send that to the 
browser.
-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/

0
12/8/2003 4:42:49 PM
Agreed and again was just trying to kill two birds with one stone.

I will most like duplicate the css file as a true xml file then use a
transformation to write out the customized css files to each user folder
space when they choose to customize.

Cheers
Keith

"Martin Honnen" <Martin.Honnen@t-online.de> wrote in message
news:e9ifSpavDHA.2488@TK2MSFTNGP10.phx.gbl...
>
>
> Keith Chadwick wrote:
>
> > As I stated I am trying to kill to birds with one stone.  I have checked
> > across several several different browsers and down level browsers as
well
> > and there appears to be no problem with any of the browsers picking up
the
> > CSS.
> >
>
> The CSS validator at
> http://jigsaw.w3.org/css-validator/validator-text.html
> will tell you that most of that example is unrecognized.
> Even if the browsers can cope with your CSS in XML I don't think you
> should send more to a browser than is needed and force them to try to
> parse the XML as CSS if there are techniques like XSLT which would allow
> you to extract the CSS rules from the the XML and just send that to the
> browser.
> -- 
>
> Martin Honnen
> http://JavaScript.FAQTs.com/
>


0
chady (6)
12/8/2003 4:47:28 PM
Reply:

Similar Artilces:

Auto suggest
One of the features i like from Open Office, is the auto-suggest / auto-complete word as you type. Say for example i type accommo the program will show accommodation as an option and i just hit enter to make the choice accepted. Can Word do this too? It could through Word2003, and it's been reported that the feature was restored in Word2010. Although if you've already gotten as far as "accommo," that particular AutoCorrect doesn't do you much good, since in that word it's the number of c's and m's that's tricky, and how would it know wheth...

XML problems
considering the following xml example <?xml version="1.0" encoding="ISO8859-1"?> <results> <interaction> <point> <auxf>6.812890</auxf> <auxh>0.000000</auxh> </point> <point> <auxf>5.614157</auxf> <auxh>0.479757</auxh> </point> <point> <auxf>4.040000</auxf> <auxh>38.000000</auxh> </point> </interaction> <interaction> <point> <auxf>6.812890</auxf> <auxh>0.000000</auxh>...

excel repair, remove records from xml part
morning all. I've been experiencing what strikes me as a problem since we bought office 2007, just over two years ago now, and now a colleague just experienced the same problem. Occasionally we'll receive an error message stating that some equation, or record, etc... was damaged and needed to be removed from the record. The worksheet/book gets repaired, and we must save the repair. Typically it's at least two worksheets in the "xml.part" of the file. "sheetA", and "calcChain." For me, I just go into the developer tab, open the VBE, locate the a...

Cognos XML-Schema
Hi ng, I can't handle this XML-Schema (below) I want to access the data like "Select Name from DATA". <?xml version="1.0" encoding="utf-8"?> <dataset xmlns="http://developer.cognos.com/schemas/xmldata/1/" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"> <!-- <dataset xmlns="http://developer.cognos.com/schemas/xmldata/1/" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:schemaLocation="http://developer.cognos.com/schemas/xmldata/1/ xmldata.xsd" > --> <met...

Two Deep XML?
This is a multi-part message in MIME format. ------=_NextPart_000_0006_01C5D3EC.718FA8B0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have some code which creates an XML output like this: < Product> <Product ID>1</ProductID <ProductValue>5.00</ProductVaue> </Product> < Product> <Product ID>2</ProductID <ProductValue>10.00</ProductVaue> </Product> Here it is: newElem =3D doc.CreateElement("Product"); childElem =3D...

chtmlview and xml
Hi, From withing a CHtmlView If I navigate to an xml file everything is fine, it reads the xsl file from within the xml if I use IPersistStreamInit to read the same xml info from memory it doesn't use the xsl inside. is it me that are doing wrong or is it so that I can't use IPersistStreamInit with xml? thanks /Niklas Hello Niklas, Thanks for your post. I'd like to share the following information with you: As you know, .xsl is a style sheet which describes how to present an XML file in browser. When we loading an xml file in CHtmlView, it will not only parse the xml conten...

Sort Xml using XpathExpression Addsort() #2
hi, i have a xml file <root> <Type /> <Description /> <Category /> <employee > <id>3</id> </employee> <employee> <id>1</id> </employee> <employee> <id>5</id> </employee> </root> and i want output xml as <root> <Type /> <Description /> <Category /> <employee > <id>1</id> </employee> <employee> <id>3</id> </employee> <employee> <id>5</id> </employee> </root> that is i want updated xml to ret...

Your suggestion?
I'm writing a small program on Win32 MFC where user can login to do something. Now I would like to implement the automatic logout when the user is logged in and there was no mouse nor keyboard activity for e.g. 10 seconds? Since there is a lot WM_x messages that mouse and keyboard produces I could listen to it's to much work and probably not so elegant. Must I use keyboard and mouse hook for this or you think there is a better solution? How to know if my app was in idle time when it comes to user input? Thanks for help! "blue" <blue@blue.blue> wrote in messa...

Appending to XML file instead of overwriting
Hello All. There is an automatic way to save just the changes of a xml file? For example, if add several nodes, delete some and change the value or attribute of another. Actually, on saving it, the Save( ) method will serialize the entire file again. The doubt is if this behaviour can be changed, making the parser keep the file and saving only the changes. I have a customer asking for it, but I guess it is not possible, due to XML way of work. Or, am I wrong? Can someone discuss about, please? Cesar wrote: > There is an automatic way to save just the changes of a xml file? >...

ICollection and xml
Hi, I am trying to use the an xml file as the datasource for a webcontrol. The datasource must implement ICollection and a datamember name must be provided too. Can someone please provide a sample as to if and how one make the xml data a datasource which implements ICollection and hence bind the following data - 'name' attribute(in an xml file - test.xml): <entry> <name>Shift Report_files</name> <type /> <isdir>True</isdir> </entry> - <entry> <name>SQL Queries</name> <type /> <isdir>True</isdir> ...

Embedded CSS in XML
Hi everybody, I've just learned how to attach a CSS file to a simple XML document with: <?xml-stylesheet href="css_file.css" type="text/css" ?> It is possible to incrust the CSS definitions in the same XML? Regards, MVR Mario V�zquez wrote: > I've just learned how to attach a CSS file to a simple XML document with: > > <?xml-stylesheet href="css_file.css" type="text/css" ?> > > It is possible to incrust the CSS definitions in the same XML? I don't know what that has to do with .NET XML, the topic of thi...

Write xml to a string
how can you create an xml document and put it in a string variable instead of writing it to a file? "Tim Faircloth" <anonymous@discussions.microsoft.com> wrote in message news:5F85F05D-519B-4B5E-9CEE-44474FE6837A@microsoft.com... > how can you create an xml document and put it in a string variable instead of writing it to a file? Use the XmlDocument.OuterXml property to get the string representation. "Tim Faircloth" <anonymous@discussions.microsoft.com> wrote in message news:5F85F05D-519B-4B5E-9CEE-44474FE6837A@microsoft.com... > how can you create a...

Minimum requirements for XML file for visio org chart
I am trying to develop the minimum requirements needed in a XML file for import into a Visio org chart (Boxes, with a few lines of text each, and connectors between them). Does any one have an example? ...

suggestions
how to sustain a corporate culture in home business Wear a tie with your pajamas. -- <%= Clinton Gallagher, "Twice the Results -- Half the Cost" Architectural & e-Business Consulting -- Software Development NET csgallagher@REMOVETHISTEXTmetromilwaukee.com URL http://www.metromilwaukee.com/clintongallagher/ "tafesdelites" <ourshady2@yahoo.com(seriuos help only)> wrote in message news:E19404E5-DF52-4BE2-B535-63D48A5FBF1F@microsoft.com... > how to sustain a corporate culture in home business > > Totally laughing at t...

Suggestion for Searching
I enjoy using OneNote. But there is one thing it can't do that, to me, would seem fundamental. It's amazing what it CAN search: sound, images, text. That's good. But it would seem obvious that it should also be able to search the text within attached files if .pdf, .doc, .xls, .ppt, etc. I would think that OneNote should at least be capable of highlighting an attached file to let you know that the search string is found within the attached, embedded document somewhere. If there is a way to do this, I apologize for the post. But I haven't yet discovered ho...

XML covert to string issue
I have a (SQL Server 2005) table with a field (defined as TEXT) that contains an XML document. In VB.NET (VS 2005) I need to get this xml document and perform XPath statements on it. When I get the XML document and convert it to a string I loose part of the document. Dim xmltext As New System.Text.StringBuilder Dim strReader As StringReader = New StringReader(xmltext.ToString) Dim reader As XmlTextReader = New XmlTextReader(strReader) Dim strSQL As New System.Text.StringBuilder strSQL.Append("SELECT msg as VAL from tblMessage WHERE ID=100") 'routine ExecSQLReturnVal execut...

synchronization of Xml file access in .net Pro
Hi, Iam trying to develop a solution for my comapny in MS VS Pro, using C++.net. My work involves extensive usage of xml as well. I use DOM model for xml opeartions. Now the problem scenario is that multiple clients might be using my application as same time and trying to modify/update the same xml file. Therefore i need a mechanism to provide a synchronous access to the xml file. One very obvious solution to this problem is that I use lock on the file access. Other solution can invlove some kind of usage of synclock to lock the block the code accessing/updating the xml file. But i guess bo...

Clearing Automatic Name Checking/Suggestion
Does anyone know how to clear the memory setting for automatic name checking? When it suggests an email address, it gives me an old one or incorrect one from my outlook that is no longer in my Contacts and it's frustrating. Please advise, I've already tried turning the settings on and off with no luck. Thanks, KjL ...

Binding XML with attribute to datagrid.
Why is it that when I want to use an attribute like for instance: .WriteAttributeString("WaiterId", "14") and later on (in another application) want to bind the xml to a datagrid with readxml I'm not getting any records (just one row with 14 in it..) If I ommit the attribute it works just fine? What am I doing wrong here, have to admit I'm more or less discovering xml.. Thanks in advance, Mike [Code snippet which writes the XML (Compact Framework)] pXTWWriter = New XmlTextWriter(iFileName, System.Text.Encoding.Default) 'WRITE THE ...

Payroll Product Suggestion
If anyone wants to improve GP's payroll reconcile function which doesn't work right, please vote for the product suggestion 369961. In particular the payroll summary (UPR30301) table not updating correctly without SQL queries. Last I heard Microsoft operates by the number of votes a product suggestion gets.....more than 10 and it will get looked more quickly and changed sooner. KB article 874131 says reconcile will update the UPR30301 table by simply running reconcile. It doesn't unless you delete records in the UPR30301 table. Only way to do that is throught SQL. ...

Path in XML
Hi, I am working with XMLDocuments, and i go through it with XMLNode, and i want know for each node the path in the XMlDocuments. For instance for this XML i want get for each nodes the following: testlayer testlayer/text1 testlayer/text1/text11 testlayer/text1/text112 testlayer/text2 and so on. How can i get with XMLNode objects in .Net Framework? or using another objects? Thanks, Cheers. *** Xml *** <?xml version="1.0" encoding="UTF-8"?> <testlayer> <text1>test1 <text11>test11</text11> <text112>test112</text112> </te...

XML #2
hi how to read XML file using MFC. MFC itself has no support for XML. Use MSXML interfaces or XmlLite library. Or some other library could be found from the web... -- ====== Arman "vijaygani2000@gmail.com" wrote: > hi > > how to read XML file using MFC. > > I've never used it in a big project, but this class looks pretty good (I wish I could use it rather than what we are using). http://www.firstobject.com/ They have a free version and a purchase version with more features. Tom <vijaygani2000@gmail.com> wrote in message news:1178534614.701...

Calculator
(For a WinXP machine in fact and yes i can search for one myself) But just in case one of you know a good one to suggest for a person with poor eye-sight. Needed; a simple Calculator program with large or adjustable display & keys. No need for it to include advanced science options. -- Nah-ah. I'm staying out of this. ... Now, here's my opinion. Please followup in the newsgroup. E-mail address is invalid due to spam-control. Try Moffsoft 'FreeCalc' at :- http://www.moffsoft.com/ Just stretch the window and the keys etc. expand with it. On...

importing xml scheme
I have 2 crm servers. I made some customizations on one of them, exported the xml scheme with the deployment manager. When I went to import the xml scheme on the other server I got a dialog box that said it would clear the tables and if I wanted to continue. What tables is it clearing? Is it the metabase database? What happens to all the data in the MSCRM database? Is this safe or should I backup my databases? ...

virus
Got that virus which inserts a window into my browsers (Opera and Firefox), suggesting to send a SMS somewhere to get e removal code - how is this virus called and what are the remedies? uninstalled browsers, run Dr Web CureIt, installed browsers - did not help "aa" <aa@microsoft.com> wrote in message news:uTqiPjftKHA.4568@TK2MSFTNGP05.phx.gbl... > Got that virus which inserts a window into my browsers (Opera and Firefox), > suggesting to send a SMS somewhere to get e removal code - how is this virus > called and what are the remedies? > > ...