Visit Our Home Page
 Explored,Designed,Delivered.sm
Welcome, Guest. Please Login or Register (Password Reminder)


Creativyst Forums 
Support & Discussion 
Register Help Search Login  
   
   Creativyst Forums-TOP
   Web Site Design
   XML and Links
(Moderator: admin)
 Author
Topic: XML and Links       [Link=62]
Reply Please log in first.
HeathC
New Member


Posts: 3




57881481   57881481    
    XML and Links   (Date posted: 09/07/03 at 00:33:51) Quote Modify Delete

Ok, heres my delima I have a website that uses XML to hold all the data for the site (ie. the webpage is just a shell the XML files hold all the information that goes in it.

Now with out resorting to XSL can I include a link to another page in the body of the text in the XML and have it come up as a hyperlink in the HTML page?

Ok heres my html:


And now for the XML

the "nBody" tag is where I want to put my links...I know I can datasrc to an anchor, but this is different again :/

Last modification: HeathC - 09/07/03 at 00:33:51

   E-Mail   Ip: Logged
HeathC
New Member


Posts: 3




57881481   57881481    
    Re: XML and Links   (Date posted: 09/07/03 at 06:52:30) Quote Modify Delete

I have tried using this in my XML code but it doesn work either:

   E-Mail   Ip: Logged
JRepici
Administrator


Posts: 328





Gender:
      JohnRHere2
    Re: XML and Links   (Date posted: 09/07/03 at 14:39:39) Quote Modify Delete

HeathC,

Try adding this inside your nbody element:

Let me know if this works. You are still strapped with the "I.E. only" limitation... Some questions:

  • Do you have Server-Side Scripting available?
  • If you do, would you even be interestested in exploring some alternatives to how you are doing it now?

I haven't tested the code above and it's been a while since I've messed with this, but I think it should work. It uses the W3C namespace for html elements in XML.

    -jr

<edit> Sorry, let CUF try to turn the URL into a link there</edit>

Last modification: JRepici - 09/07/03 at 14:39:39

   E-Mail   Ip: Logged
HeathC
New Member


Posts: 3




57881481   57881481    
    Re: XML and Links   (Date posted: 09/07/03 at 19:15:24) Quote Modify Delete

Ok, I tried that, but when I include its DTD file NOTHING comes up and when I dont include the DTD file everything BUT the message comes up.

As for Server side scripting (PERL) yeah I do have it but I want a client side based solution for some of the creations I have in the pipeline are going to be client based.

I also tried it with another XML/DTD/HTML combo with the same results...

heres that code: msg2.xml

And here is the DTD:

And the webpage:

If you try it out it doesnt work and if you include the DTD in the XML file it REALLY doesnt work lol :/ Any ideas.

   E-Mail   Ip: Logged
JRepici
Administrator


Posts: 328





Gender:
      JohnRHere2
    Re: XML and Links   (Date posted: 09/08/03 at 11:11:24) Quote Modify Delete

HeathC, (new message)

Well I found some time to experiment and it turns out to be much easier than all this. Your original thought:

&lt;a href=&quot;mypage.htm&quot; target=&quot;NewWin&quot;&gt;Load&lt;/a&gt;

was right. The problem is the browser then translates those entities just as it would any entity input, as literal characters. So you need to prevent the HTML browser from translating the entities as characters (nothing at all to do with the XML parser).

I.E. provides a way to do this with an attribute called DataFormatAs. Use it on your HTML field span for your Msg element like this:

<div DataFormatAs="HTML" datafld="Msg"></div>

Here's a test page.

. . .






Sales Pitch

May I suggest an alternative: Use News Entry Widget to maintain your ongoing announcements. Beside archiving your entries to static pages (permalinks that are good for search engines) it also generates an RSS file (XML for publishing your announcements on syndication sites), an SSI file (for your own site if you'd like) and a JSMsg file (a JavaScript file containing your messages in an object for easy display on client-side-only web pages).

-jr

Last modification: JRepici - 09/08/03 at 11:11:24

   E-Mail   Ip: Logged
Normanka
New Member


Posts: 1




     
    Re: XML and Links   (Date posted: 01/11/05 at 17:29:01) Quote Modify Delete

My solution for hyperlinks in XML-text and render them is the following (works for years, but only in IE):
1. I put the hyperlink to the text:
<a href='some site'>linked text</a>
2. I change every left "<" to unicode-representation: "&#60;" (et+hashmark+60+semicolon)
3. I change every "&" character to unicode representation, excepted the former left bras: "&#38;" (et+hashmark+38+semicolon)
4. In the rendering the bound HTML-elements attribute DataFormatAs="HTML" must be.

This is good for the DTD-s, and is working excellently in IE: http://karoly.norman.terasz.hu

***************

Still I don't know, how can I use hyperlinks in XSL transformed XML, that is in a crossplatform solution?

   E-Mail   Ip: Logged
JRepici
Administrator


Posts: 328





Gender:
      JohnRHere2
    Re: XML and Links   (Date posted: 01/12/05 at 10:43:00) Quote Modify Delete

Normank,

Great solution for handling it from the XML side!

re: "I.E. only"

Yah me too. The irony in all of this is that XML was supposed to make everything more platform independent.

    -John

   E-Mail   Ip: Logged
Reply Please log in first.
Pages: 1
Jump to:

YaBB Board c 2000
YaBB Programming Team
 



















© Copyright 2002 - 2008 Creativyst, Inc.