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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Gertone (Geert Bormans)Information 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
Gertone (Geert Bormans)Information 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
Gertone (Geert Bormans)Information 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
Gertone (Geert Bormans)Information 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
Gertone (Geert Bormans)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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gertone (Geert Bormans)Information 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
Gertone (Geert Bormans)Information ArchitectCommented:
welcome
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.