Viewing XML documents

Can someone tell me how to view XML documents without the markup tags? Can you view .xml files in word or just HTML?


Thanks
oggiemcAsked:
Who is Participating?
 
Geert BormansConnect With a Mentor Information ArchitectCommented:
Oh, but this zip IS a microsft office word file.
change the .zip extension into .docx
and you can simply open this in Word
0
 
grayeCommented:
I'm not sure I understand the question....  

So, if the XML file has the following
<customers>
   <customer>
       <name>John Doe</name>
       <address>123 Any Street</address>
    </customer>
</customers>

You want just:

John Doe
123 Any Street

... is that correct?
0
 
oggiemcAuthor Commented:
yes grave..that is correct..how do i do that??

Thanks
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
grayeCommented:
You can effectively strip off the XML element tags by using a process called eXtensible Stylesheet Language (XSL).  You'd create a simple XSL file to remove all tags (and put it a carriage returns), and "attach it" to the XML.   Then when you open the file again (using Internet Explorer) it will auotmatically strip off the XML element tags and add the carriage returns.

Let's start this journey with you doing a bit of reading on the http://www.w3schools.com web site about XSL Transforms.  After you've digested that (it might take a while!), come back here and we can help you with creating and attaching an XSL file.

0
 
Geert BormansInformation ArchitectCommented:
Well, if you need to learn XSLT for this task, you are doing overkill

The easiest way for viewing an XML file is using CSS and view it in a browser

simply put an xml-stylesheet Process Instruction in front of your XML, attach a very simple CSS and throw it in a browser
<?xml-stylesheet href="customers.css" type="text/css"?>
<customers>
   <customer>
       <name>John Doe</name>
       <address>123 Any Street</address>
    </customer>
</customers>

Open in new window

0
 
Geert BormansInformation ArchitectCommented:
All things you want to see on a new line can be put in a block, here is the CSS, it is as simple as that

You can do very exciting and beautifull stuff with CSS and XML,
thought it has its limitations.
Unless you really need complex rendering, there is no need to go for XSLT here

Note: I don't ever recommend the w3Schools tutorials, they are purely syntactical, they don't really teach what it is all about
and mainly the stuff about XPath is very confusing since the tutorial fails to say what is XPAth1 and what is XPAth2

There are tools such as Oxygen or XMetaL, Syntex Serna, ...
that allow you to view a WYSISWIGG view of your XML, but they all follow the CSS approach anyhow... no need to buy tools at this stage
name
	{
		display:block;
	}

address
	{
		display:block;
	}

Open in new window

0
 
Geert BormansInformation ArchitectCommented:
oh by the way
the ultimate simple css

All you need to view your XML without tags

(though you might want to add some indenting to show hierarchy)
*
	{
		display:block;
	}

Open in new window

0
 
Geert BormansInformation ArchitectCommented:
this one maintains the indenting in some way

(jsut copy the 5 lines in a file and reference the name in the PI)
*
	{
		padding-left: 15px;;
		display:block;
	}

Open in new window

0
 
oggiemcAuthor Commented:
Hi Gertone,

Thanks for reply..

I was sent the zipped file from lecturer which had all XML in it.. So i assume whatever style sheets are needed are in there.. Can you have a look and tell me how to open it please?  The document i need is the document.xml in the word folder.. Is it possible to open XML in word??

Thanks,
Fergal
0
 
oggiemcAuthor Commented:
Heres the file..
xml.zip
0
 
Geert BormansInformation ArchitectCommented:
If you use Office 2003 or older, you might need to install a filter to open this file.
But office will tell you what to do
0
 
oggiemcAuthor Commented:
Gertone,

Thanks a million for the precise and correct answer..Points coming your way! :)

0
 
Geert BormansInformation ArchitectCommented:
welcome
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.