XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 13th, 2004, 06:57 PM
DZero DZero is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 7 DZero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
HTML inside XML

Hi guys, i'm having a trouble here ... i'm a n00b about XML,
so, my question is, "is that possible to put HTML tags inside XML???" and if YES... HOW?

I'm testing some stuff for my band website, and then
i wanted to do the NEWS section in XML, but, i realized
that i'll need some links on the texts, and i have no idea
about how to do it in XML

here's my xml code::
---------------------------------------------
---------------------------------------------

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited with XML Spy v4.2 -->

<BANDNEWS>

<BNEWS>
<DATE>07/10/2004</DATE>
<BNTEXT> sample text... sample text...</BNTEXT>
</BNEWS>

---------------------------------------------
---------------------------------------------

is there any way to put any of these "sample text" as
LINK ??

thx a lot!

Reply With Quote
  #2  
Old July 13th, 2004, 09:59 PM
NotGoddess's Avatar
NotGoddess NotGoddess is offline
Kung-fu Kitty
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 350 NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 6 h 9 m 2 sec
Reputation Power: 10
Send a message via AIM to NotGoddess
See this thread for two methods:
http://forums.devshed.com/showthread.php?t=126100

Reply With Quote
  #3  
Old July 14th, 2004, 12:30 AM
DZero DZero is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 7 DZero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
there might be smth wrong with my code... i couldn't do that.

i'll past my code here, so u'll have an idea of what i want to do.

---------------------------------
XML file (a kinda NEWS database)
---------------------------------

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited with XML Spy v4.2 -->

<BANDNEWS>
<BNEWS>
<DATE>10/07/2004</DATE>
<TEXT>
HERE'S A SAMPLE TEXT 01
</TEXT>
</BNEWS>

<BNEWS>
<DATE>14/06/2004</DATE>
<TEXT>
HERE'S A SAMPLE TEXT 02
</TEXT>
</BNEWS>

</BANDNEWS>

---------------------------------
HTML+CSS FILE
---------------------------------
<html>
<body>

<xml id="bandanews" src="bandnews2004.xml"></xml>

<table>

<tbody>
<tr>
<td width="8" bordercolor="#000000">
<divalign="center">
<img src="img/seta.jpg" width="4" height="7">
</div>
</td>
<td colspan="2" bgcolor="#666666">
<span datafld="DATE">
</span>
</td>
</tr>
<tr>
<td colspan="2" bordercolor="#000000">&nbsp;</td>
<td width="602" bordercolor="#000000">
<span datafld="TEXT"></span>
</td>
</tr>
</tbody>

</table>

</body>
</html>

-------------------------------------------
-------------------------------------------
I wanted to put a word as a link on the XML
like, when you click at "SAMPLE TEXT 01"
u'll go to another page in a new window
(if possible) and on the same window.

anyone can fix my code to do that.

thx a lot

Reply With Quote
  #4  
Old July 14th, 2004, 07:03 AM
Miska's Avatar
Miska Miska is offline
Madden Maniac
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2001
Location: Finland
Posts: 519 Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 3 h 47 m 50 sec
Reputation Power: 8
Just a quick q... why aren't you using XSLT? This would be a piece of cake with it...

Miska

Reply With Quote
  #5  
Old July 14th, 2004, 09:50 AM
DZero DZero is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 7 DZero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by Miska
Just a quick q... why aren't you using XSLT? This would be a piece of cake with it...

Miska


because i dunno XSLT ...

Reply With Quote
  #6  
Old July 14th, 2004, 10:18 AM
Miska's Avatar
Miska Miska is offline
Madden Maniac
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2001
Location: Finland
Posts: 519 Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 3 h 47 m 50 sec
Reputation Power: 8

Reply With Quote
  #7  
Old July 14th, 2004, 10:29 AM
DZero DZero is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 7 DZero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i already tried there, but, i can't find any example of how to do this

Reply With Quote
  #8  
Old July 15th, 2004, 01:42 AM
Miska's Avatar
Miska Miska is offline
Madden Maniac
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2001
Location: Finland
Posts: 519 Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 3 h 47 m 50 sec
Reputation Power: 8
just a few tags you might find worth looking at:

xsl:template
xsl:for-each
xsl:value-of

-M-

Reply With Quote
  #9  
Old July 17th, 2004, 02:36 AM
NotGoddess's Avatar
NotGoddess NotGoddess is offline
Kung-fu Kitty
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 350 NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level)NotGoddess User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 6 h 9 m 2 sec
Reputation Power: 10
Send a message via AIM to NotGoddess
HTML links inside XML

Try this. I took the liberty of removing your tables. The CSS should do most of what you wanted to do without the bulk. Save the text to each of the named files, then open "bandnews2004.xml" in your browser.

[BEGIN XML FILE "bandnews2004.xml":]

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="bandnews2004.xsl"?>

<BANDNEWS>
<BNEWS>
<DATE>10/07/2004</DATE>
<TEXT>HERE'S A SAMPLE TEXT 01</TEXT>
</BNEWS>

<BNEWS>
<DATE>14/06/2004</DATE>
<TEXT>HERE'S A SAMPLE TEXT 02
<a href="#">HERE'S A SAMPLE LINK</a>
HERE'S A SAMPLE TEXT 02
HERE'S A SAMPLE TEXT 02
</TEXT>
</BNEWS>
</BANDNEWS>

[END XML FILE "bandnews2004.xml"]

[BEGIN XSL FILE "bandnews2004.xsl"]

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:template match="/">
<html>
<head>
<title>Band News 2004</title>
<style>
.date { width: 602px; height: 2em; line-height: 2em; color: white; background: black; border: 1px black solid; }
img { padding: 0 5px 0 5px; }
.text { width: 602px; height: auto; border: 1px black solid; }
</style>
</head>
<body>
<xsl:for-each select="//BNEWS">
<xsl:sort select="DATE" />
<div class="date">
<img src="your_icon.gif" /> <xsl:value-of select="DATE" />
</div>
<div class="text"><xsl:copy-of select="TEXT" /></div>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

[END XSL FILE "bandnews2004.xsl"]

Reply With Quote
  #10  
Old July 17th, 2004, 11:02 AM
DZero DZero is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 7 DZero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
THANK YOU VERY MUCH!!!
that was exactly what i was looking for.!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > HTML inside XML


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT