|
If you create a html page, you need to give it a .html extension, instead of .txt. Then, double click on the file, IE will open it.
Basically, creating a web page using XML just means you use XHTML, which in turn essentially means that the HTML needs to be XML. This is HTML, but not XML
one line<br>another line
That is because the <br> tag is never closed. To solve this, do this instead:
one line<br/>another line
this is another example:
this <strong>text has <em>some bold</strong> and </em>some italics
strong and em are the recommended tags, they replace b and i, from memory ( years since I used them ). This is not valid XML as the tags do not line up. To replace this, you'd need to work out a solution where the tags do not next. The following would not look the same, but illustrates the idea:
this <strong>text has <em>some bold</em> and </strong>some italics
So - all you need to do is create an HTML page that is entirely XML compiliant. An easy way to make sure is to download XML Spy Home Edition, it is a half decent XML editor. It will also help you with writing XSLTs, which are transformations on XML to produce a new document which may or may not be XML.
So, if you've not done XML for years, why are you doing an assignment on XML ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks for your help. I will have a go at it now and let you know how i'm doing. I'm taking a course called Computer Studies and there's 6 modules in the course. The course contains a mixture of everything, 1 module is database development, another is web design and so on. The module i'm doing at the moment is advanced internet development and this assignment happens to be on XML. My lecturer is useless and all he's said is to search for tutorials to help.
I have managed to get the XML text displayed in the browser so that's a start, at least i'm making progress! Now I can do that, i'll concentrate on writing some code to help me create a default opening page. I suppose i'll have to look through more tutorials to help me with that! Thanks for your help so far
|
|
|
|
|
No worries - sounds like you're on the right track. Ask again if you need help.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you Christian, really appreciate it
|
|
|
|
|
Christian, I have found a good example of a CD catalog I may use to help me. The code is as follows:
-
- <catalog>
- <cd>
<title>Empire Burlesque
<artist>Bob Dylan
<country>USA
<company>Columbia
<price>10.90
<year>1985
- <cd>
<title>Hide your heart
<artist>Bonnie Tyler
<country>UK
<company>CBS Records
<price>9.90
<year>1988
- <cd>
<title>Greatest Hits
<artist>Dolly Parton
<country>USA
<company>RCA
<price>9.90
<year>1982
- <cd>
<title>Still got the blues
<artist>Gary Moore
<country>UK
<company>Virgin records
<price>10.20
<year>1990
- <cd>
<title>Eros
<artist>Eros Ramazzotti
<country>EU
<company>BMG
<price>9.90
<year>1997
- <cd>
<title>One night only
<artist>Bee Gees
<country>UK
<company>Polydor
<price>10.90
<year>1998
- <cd>
<title>Sylvias Mother
<artist>Dr.Hook
<country>UK
<company>CBS
<price>8.10
<year>1973
- <cd>
<title>Maggie May
<artist>Rod Stewart
<country>UK
<company>Pickwick
<price>8.50
<year>1990
- <cd>
<title>Romanza
<artist>Andrea Bocelli
<country>EU
<company>Polydor
<price>10.80
<year>1996
- <cd>
<title>When a man loves a woman
<artist>Percy Sledge
<country>USA
<company>Atlantic
<price>8.70
<year>1987
- <cd>
<title>Black angel
<artist>Savage Rose
<country>EU
<company>Mega
<price>10.90
<year>1995
- <cd>
<title>1999 Grammy Nominees
<artist>Many
<country>USA
<company>Grammy
<price>10.20
<year>1999
- <cd>
<title>For the good times
<artist>Kenny Rogers
<country>UK
<company>Mucik Master
<price>8.70
<year>1995
- <cd>
<title>Big Willie style
<artist>Will Smith
<country>USA
<company>Columbia
<price>9.90
<year>1997
- <cd>
<title>Tupelo Honey
<artist>Van Morrison
<country>UK
<company>Polydor
<price>8.20
<year>1971
- <cd>
<title>Soulsville
<artist>Jorn Hoel
<country>Norway
<company>WEA
<price>7.90
<year>1996
- <cd>
<title>The very best of
<artist>Cat Stevens
<country>UK
<company>Island
<price>8.90
<year>1990
- <cd>
<title>Stop
<artist>Sam Brown
<country>UK
<company>A and M
<price>8.90
<year>1988
- <cd>
<title>Bridge of Spies
<artist>T'Pau
<country>UK
<company>Siren
<price>7.90
<year>1987
- <cd>
<title>Private Dancer
<artist>Tina Turner
<country>UK
<company>Capitol
<price>8.90
<year>1983
- <cd>
<title>Midt om natten
<artist>Kim Larsen
<country>EU
<company>Medley
<price>7.80
<year>1983
- <cd>
<title>Pavarotti Gala Concert
<artist>Luciano Pavarotti
<country>UK
<company>DECCA
<price>9.90
<year>1991
- <cd>
<title>The dock of the bay
<artist>Otis Redding
<country>USA
<company>Atlantic
<price>7.90
<year>1987
- <cd>
<title>Picture book
<artist>Simply Red
<country>EU
<company>Elektra
<price>7.20
<year>1985
- <cd>
<title>Red
<artist>The Communards
<country>UK
<company>London
<price>7.80
<year>1987
- <cd>
<title>Unchain my heart
<artist>Joe Cocker
<country>USA
<company>EMI
<price>8.20
<year>1987
However, when I try loading this in IE, shouldn't IE be able to render these XML files? Shouldn't there be red + and - symbols which when clicked expand/collapse the contents? The code is found at the following link: www.w3schools.com/xml/cd_catalog.xml. But when I try copying it into notepad or wordpad the + and - symbols go missing Help please!
|
|
|
|
|
Strange, the titles have gone missing. here it is again properly:
-
<catalog>
<cd>
<title>Empire Burlesque
<artist>Bob Dylan
<country>USA
<company>Columbia
<price>10.90
<year>1985
<cd>
<title>Hide your heart
<artist>Bonnie Tyler
<country>UK
<company>CBS Records
<price>9.90
<year>1988
<cd>
<title>Greatest Hits
<artist>Dolly Parton
<country>USA
<company>RCA
<price>9.90
<year>1982
<cd>
<title>Still got the blues
<artist>Gary Moore
<country>UK
<company>Virgin records
<price>10.20
<year>1990
<cd>
<title>Eros
<artist>Eros Ramazzotti
<country>EU
<company>BMG
<price>9.90
<year>1997
<cd>
<title>One night only
<artist>Bee Gees
<country>UK
<company>Polydor
<price>10.90
<year>1998
<cd>
<title>Sylvias Mother
<artist>Dr.Hook
<country>UK
<company>CBS
<price>8.10
<year>1973
<cd>
<title>Maggie May
<artist>Rod Stewart
<country>UK
<company>Pickwick
<price>8.50
<year>1990
<cd>
<title>Romanza
<artist>Andrea Bocelli
<country>EU
<company>Polydor
<price>10.80
<year>1996
<cd>
<title>When a man loves a woman
<artist>Percy Sledge
<country>USA
<company>Atlantic
<price>8.70
<year>1987
<cd>
<title>Black angel
<artist>Savage Rose
<country>EU
<company>Mega
<price>10.90
<year>1995
<cd>
<title>1999 Grammy Nominees
<artist>Many
<country>USA
<company>Grammy
<price>10.20
<year>1999
<cd>
<title>For the good times
<artist>Kenny Rogers
<country>UK
<company>Mucik Master
<price>8.70
<year>1995
<cd>
<title>Big Willie style
<artist>Will Smith
<country>USA
<company>Columbia
<price>9.90
<year>1997
<cd>
<title>Tupelo Honey
<artist>Van Morrison
<country>UK
<company>Polydor
<price>8.20
<year>1971
<cd>
<title>Soulsville
<artist>Jorn Hoel
<country>Norway
<company>WEA
<price>7.90
<year>1996
<cd>
<title>The very best of
<artist>Cat Stevens
<country>UK
<company>Island
<price>8.90
<year>1990
<cd>
<title>Stop
<artist>Sam Brown
<country>UK
<company>A and M
<price>8.90
<year>1988
<cd>
<title>Bridge of Spies
<artist>T'Pau
<country>UK
<company>Siren
<price>7.90
<year>1987
<cd>
<title>Private Dancer
<artist>Tina Turner
<country>UK
<company>Capitol
<price>8.90
<year>1983
<cd>
<title>Midt om natten
<artist>Kim Larsen
<country>EU
<company>Medley
<price>7.80
<year>1983
<cd>
<title>Pavarotti Gala Concert
<artist>Luciano Pavarotti
<country>UK
<company>DECCA
<price>9.90
<year>1991
<cd>
<title>The dock of the bay
<artist>Otis Redding
<country>USA
<company>Atlantic
<price>7.90
<year>1987
<cd>
<title>Picture book
<artist>Simply Red
<country>EU
<company>Elektra
<price>7.20
<year>1985
<cd>
<title>Red
<artist>The Communards
<country>UK
<company>London
<price>7.80
<year>1987
<cd>
<title>Unchain my heart
<artist>Joe Cocker
<country>USA
<company>EMI
<price>8.20
<year>1987
|
|
|
|
|
For some reason the <cd> titles etc aren't copying. If you could just type http://www.w3schools.com/xml/cd_catalog.xml into your browser you will see what code I am on about. I copy it into notepad, save it as a .html file, but when I try opening it up in IE, the XML files aren't rendered, there's no red + and - symbols like there should be?
|
|
|
|
|
Hi R0ssini,
Read the following article to get a good hand on your xml basics. This handbook is meant for novice xml programmers.
I am sure this will help you clear the basics to some extent. If you have any further queries, do email us. We shall get back to you with solution.
regards,
Itech
Itech Consulting
www.itechconsulting.co.in
|
|
|
|
|
Hi R0ssini,
Forgot to post you the link in our earlier mail. Its -
www.codeproject.com/useritems/XML_Basics.asp
regards,
Itech Consulting
Itech Consulting
www.itechconsulting.co.in
|
|
|
|
|
I have studied my own way to an advanced degree in computer science and taught a number of programming courses along the way. I would love to help...
Go to class on the days that it is taught, engage your professor during office hours and ask for assitance from him. Study the lecture material and ask for clarifications in class. Do your homework when it is assigned to the best of your ability. Don't take classes you have no business taking and hope you can beg your way to a good grade on the Internet.
CodeProject is not a site to come to to get professionals to do your school work for you.
There is a part of the assignment that you may want to reread: "YOU are required to demonstrate YOUR understanding." I'd do this for you, but I already passed all my classes.
-- modified at 20:59 Thursday 12th January, 2006
|
|
|
|
|
What's the point of this messageboard existing if you can't ask for help? Don't you have a go at me, I attend all the lectures and have read all the notes, looked at websites and have even taken a book from the library but i'm still struggling. Luckily a helpful guy above has assisted me and now i'm alright. If you're not posting to help me out, don't bother posting to me at all!
|
|
|
|
|
Hi Friends,
I am developing a web application using C#.net and using xml as a database.
I am using xml Schema for all my xml files.
NO I want to export data from those xml files to excel sheet to create reports.
For that I create xml stylesheets means .xslt files.
and Using XsltTransform I am exporting data from xml files to excel sheets.
Now the problem is if my xml files r bound with schemas this idea is not working.
I have to remove schema attribute from the root node of the xml file. and if I am doing this then there is no mean to using schema.
Is there any way to use xslt file with the xml file which is bound with xml schema?
If any one of u have any idea regarding this, plz let me know.
Thank u all in advance.
Chetan Ranpariya.
|
|
|
|
|
How can I do this? I simply want to add the "im" field (which is in the XML file) at the end of the path of the new Bitmap line of code, so that the correct jpg is shown. I've created filestreams and everything works fine for the the text fields. The images are located in the "Program Files\SmartDeviceApplication1" directory, as is the XML file. If I type in the actual name of an image, it works, but of course the image is shown for every entry. (So I know the directory path is correct) Right now I'm getting "cannot convert string to System.Drawing.Image"
In the simplest sense, I want to do this:
\\Program Files\\SmartDeviceApplication1\\<im>
so that it reads:
\\Program Files\\SmartDeviceApplication1\\kopf_ap.jpg
Any help is appreciated! Martina
Snippet XML file:
<im>>kopf_ap.jpg</im>
Snippet Code (C#)
<br />
<br />
picbox.DataBindings.Add("Image",dt,"im");<br />
<br />
Bitmap bmp= new Bitmap("\\Program Files\\SmartDeviceApplication1\\");<br />
<br />
this.picbox.Image = bmp +"im";
|
|
|
|
|
Maybe you need to do this?
picbox.DataBindings.Add("Image",dt,"im");
Bitmap bmp= new Bitmap("\\Program Files\\SmartDeviceApplication1\\" + im);
this.picbox.Image = bmp;
|
|
|
|
|
Thank you, I had tried that, but it didn't seem to work.
I ended up doing this:
string root = "\\Program Files\\SmartDeviceApplication1\\";<br />
DataRowView drv = (DataRowView)ca_id.SelectedItem;<br />
<br />
ca_bildurl.Image = new Bitmap(System.IO.Path.Combine(root,drv.Row["im"].ToString()));
I now have another problem - the SelectedItem doesn't seem to work, but at least the first image is being shown. Thanks for your reply, though!
|
|
|
|
|
Hai,
I have grouped the paragraph styles of same type using the following method.
<!-- match paragraph nodes that are part of a Bullet list -->
<xsl:template match="w:p" mode="insideBulletList">
<!-- output this bullet item paragraph -->
<li><xsl:apply-templates /></li>
<!--go to next one-->
<xsl:apply-templates
select="following-sibling::*[1][self::w:p/w:pPr/w:pStyle[@w:val='BulletList']]"
mode="insideBulletList" />
</xsl:template>
My Wordml contains the following paragraph styles
w:p[w:pPr/w:pStyle[@w:val="para1"]
w:p[w:pPr/w:pStyle[@w:val="para2"]
w:p[w:pPr/w:pStyle[@w:val="para3"]
I want to group the above 3 different styles under one parent node like
<newnode>
<para1>38293</para1>
<para2>sdjfkj</para2>
<para3>eiruwio</para3>
</newnode>
I brought the above output using <xsl:for-each select="*" group-starting-with=""> method. But I want the above output using <xsl:template match> method so that it will maintain the position.
anybody help me!!!!!!!!!
|
|
|
|
|
Input XML:
---------
<artbody>
<section id="s1">
<heading1 level="1">INTRODUCTION</heading1>
<para>xxx <b>xxx</b> xxxxxxxxxxxxxxxxxxx</para>
<subsect id="s1-1">
<heading2 level="2">Linkends</heading2>
<para>This paragraph contains fixed figure <fx1>, <fx2>, <fx3>.</para>
<para>This paragraph contains linkend type for Bibliography (numbered) (type=bib): [<link type="bib" linkend="">3</link>], [<link type="bib" linkend="">4, 7</link>], [<link type="bib" linkend="">7–12</link>], [<link type="bib" linkend="">14-18</link>], [<link type="bib" linkend="">3, 5, 7–12</link>] and [<link type="bib" linkend="">6, 8, 15-17</link>].</para></subsect1>
<subsect1 id="s1-5-1">
<heading3 level="3">Question and Answer</heading3>
<quest>What's you name?</quest>
<answer>Pradeep</answer>
<quest>How old are you?</quest>
<answer>62</answer>
<quest>So, what are you doing now?</quest>
<answer>Just chatting with an idiot</answer> </subsect>
</subsect>
<subsect1 id="s1-5-1">
<heading3 level="3">poem</heading3>
<stanza></b>What's you name?<b></stanza>
<stanza></b>Pradeep<b></stanza>
</subsect>
<para>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</para>
<para>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</para>
</section>
</artbody>
Style Sheet:
-----------
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
xmlns:aml="http://schemas.microsoft.com/aml/2001/core"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
xmlns ="urn:schemas-microsoft-com:office:office"
exclude-result-prefixes="aml w wx o v">
<xsl:output method="xml"
indent="yes"
omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="*">
<xsl:choose>
<xsl:when test="artbody">
<xsl:copy>
<xsl:for-each-group select="child::node()" group-adjacent="self::quest or self::answer">
<xsl:choose>
<xsl:when test="current-grouping-key()">
<b> <quanta></b>
<xsl:apply-templates select="current-group()"/>
</quanta>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="current-group()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each-group>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Questions:
---------
1. I would like to group 'quest' & 'answer' under 'qanda'
2. I would like to group 'stanza' under 'poem'
I want to read each element dynamically and should group the orphan nodes such as quest & stanza under another parent element. But, with your suggestion, I could group one at a time. I couldn't do it in a loop. When I tried, I am getting duplicate of orphan nodes and all the attribute values are discarded.
If you could help us to design a xslt that groups "quest & answer" and "stanza" dynamically and retains all other elements untouched.
I sincerely appreciate your help in this regard.
Thanks & Regards,
-Rocxy
|
|
|
|
|
Sorry, very stupid question, but.... how do I specify paths in XML?
In other words, I want to specify a "root directory" for image files.
Thanks!
|
|
|
|
|
Could you use something like the base tag in XHTML?
|
|
|
|
|
Hi Friends,
In my application I am using XML as database and my application is web based applicaton.
I want the user to be able to export data in xml file to a excel sheet.
I tried with various codes and samples but no one worked.
If any one have some thing ragarding this problem plz let me know.
Thank u all in advance.
Chetan Ranpariya.
|
|
|
|
|
I have the following XML
-----------------------------------
<fname>aaaaa</fname>
<surname>xxxx</surname>
<fname>bbbbb</fname>
<surname>yyyyy</surname>
<fname>ccccc</fname>
<surname>zzzzz</surname>
-----------------------------------
I want the following output
-----------------------------------
<authorgrp>
<author>
<fname>aaaaa</fname>
<surname>xxxx</surname>
</author>
<author>
<fname>bbbbb</fname>
<surname>yyyyy</surname>
</author>
<author>
<fname>bbbbb</fname>
<surname>yyyyy</surname>
</author>
</authorgrp>
------------------------------
Anyone can help??????????????????
-- modified at 1:59 Thursday 29th December, 2005
|
|
|
|
|
Try this...
<xsl:template match="/">
<authorgrp>
<xsl:for-each select="fname">
<author>
<fname><xsl:value-of select="."/></fname>
<surname><xsl:value-of select="../surname[position()]"/></surname>
</author>
</xsl:for-each>
</authorgrp>
</xsl:template> I haven't tested it, but it should get you close.
Michael Flanakin
Web Log
-- modified at 9:55 Thursday 29th December, 2005
|
|
|
|
|
I want to store an xml file in sqlserver using asp
xml file should be used as an input paramenter for a stored procedure
suneel
|
|
|
|
|
I want function in one namespace to create instance of class defined in
another namespace.
(more detailed - I try to make independent "Seralizer" dll, to be used
by different application, each calling it from its own class which
defines the application configuration)
I failed to make it work.
Notify that in the Seralizer source I dont know the definition of the
class I get.
Foe example, how do I make lines like below working?
public void Deserialize(Type cfgType)
{
myType obj = Activator.CreateInstance(cfgType);
XmlSerializer serializer = new XmlSerializer( cfgType);
FileStream stream = new FileStream("some file...", FileMode.Open,
FileAccess.Read);
cfgType configuration = (cfgType)serializer.Deserialize(stream);
}
thanks
Michael Lev (mlev)
|
|
|
|
|
hello
I am making DOm msxml parser .
My current compiler in visual C++ 6
but it crashes while loading xml file in loadxml() method.
if any one know how to overcome this error kindly help me ?:->
mast
|
|
|
|