Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,373 Programmers. There are 1,422 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

Store HTML in XML without describing all html tags in included XSL?

 
Reply to this topicStart new topic

Store HTML in XML without describing all html tags in included XSL?

kincaidkmf
post 7 May, 2008 - 09:12 AM
Post #1


New D.I.C Head

*
Joined: 12 Jul, 2007
Posts: 3



Hi everyone.

One of the sites I run has XML files full of html, like so:

CODE

<document>
  <content>
   <h1>Hellow world!</h1>
   <p>Blah blah blah marketing speak.</p>
  </content>
</document>


When I transform it, I attach a XSLT file which describes a lot of HTML tags (example):

CODE

<xsl:element name="p">
  <xsl:attribute name="class"><xsl:value-of select="@class"/></attribute>
  <xsl:apply-templates />
</xsl:element>


There's got to be a better way! They're against putting the HTML content inside CDATA markers, and there's XML elements that are woven into the HTML which get transformed later.

I have a feeling that there's an "oh duh" solution I'm missing, but if you could weigh in on this, it'd be appreciated.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


Fast ReplyReply to this topicStart new topic
Time is now: 5/17/08 02:44AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month