473,387 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Viewing XML

I am no expert on the subject but some of my translation work is being
saved as XML files by a dotnet ap. Now I would like to just "read" the
text. Is there a way to turn XML automagically into something readable?
Like:
===============================
<?xml version="1.0" encoding="utf-8"?>
<!--export-->
<editionyear="2007">
<film id="11">
<!--Bled Number One-->
<originalarticle />
<originaltitle>Bled Number One</originaltitle>
<englisharticle />
<englishtitle />
<useenglishtitle>False</useenglishtitle>
<premiere>Geen</premiere>
<productioncountry>Algeria, France</productioncountry>
<productionyear>2006</productionyear>
<color>Kleur</color>
<format>35mm</format>
<screenratio>-</screenratio>
<lengthinminutes>100</lengthinminutes>
<credits>
<director>Ameur-Zaïmeche, Rabah</director>
<producers />
<sales>Les Films du Losange</sales>
<distributors>A-Film Distribution</distributors>
<scenario>Rabah Ameur-Zaïmeche, Louise Thermes</scenario>
<photography>Lionel Sautier, Olivier Smittarello, Hakim Si
Ahmed</photography>
<editor>Nicolas Bancilhon</editor>
<artdesign />
<sound>Timothee Alazraki, Bruno Auzet, Mohamed Naman</sound>
<music>Rodolphe Burger</music>
<other />
<cast>Rabah Ameur-Zaïmeche, Meriem Serbah, Abel Jafri, Farida
Ouchani, Ramzy Bedia</cast>
</credits>
<synopsis>
<short language="dutch" length="252">
<p>Fictie als een documentaire jamsessie. De filmmaker speelt
zelf de hoofdrol van een crimineel die Frankrijk is uitgezet en terug
moet naar zijn dorp in Algerije dat hij niet voor niets ooit heeft
verlaten. Improviserend en met muzikaal gevoel gefilmd. </p>
</short>
===============================
into:
===============================
Bled Number One
Algeria, France
2006
Color
35mm
100
Ameur-Zaïmeche, Rabah
Les Films du Losange
A-Film Distribution
Rabah Ameur-Zaïmeche, Louise Thermes
Lionel Sautier, Olivier Smittarello, Hakim Si Ahmed
Nicolas Bancilhon
Timothee Alazraki, Bruno Auzet, Mohamed Naman
Rodolphe Burger
Rabah Ameur-Zaïmeche, Meriem Serbah, Abel Jafri, Farida Ouchani,
Ramzy Bedia
Fictie als een documentaire jamsessie. De filmmaker speelt zelf de
hoofdrol van een crimineel die Frankrijk is uitgezet en terug moet naar
zijn dorp in Algerije dat hij niet voor niets ooit heeft verlaten.
Improviserend en met muzikaal gevoel gefilmd.
===============================

Rgds

Martin

Dec 12 '06 #1
4 1552
MartinC wrote:
I am no expert on the subject but some of my translation work is being
saved as XML files by a dotnet ap. Now I would like to just "read" the
text. Is there a way to turn XML automagically into something readable?
Yes, but.

The problem is that XML is not a single language. It's a basic syntax,
with many different languages layered on top of it. An automatic
conversion needs to understand which language you're working in, and how
it expresses what kinds of information.

There are certainly tools such as XSLT which can be used to render XML
into forms which are easier for humans to read, for example by producing
HTML from it. But to use those tools, you need to be able to describe to
them what the current structure of the XML is and how you want to map
that to the displayable version. Essentially, you're writing a program
to automate this conversion, though you're doing so in a language
designed for the purpose.

So you can get automatic rendering -- but only after someone automates
it for you. Contact whoever wrote the application you're working with,
and ask them how to obtain a rendered version of the information. Or
learn to write your own stylesheets. Or settle for reading the XML,
which *is* human-readable even when it isn't particularly human-friendly.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Dec 12 '06 #2

MartinC wrote:
I am no expert on the subject but some of my translation
work is being saved as XML files by a dotnet ap.
[byte order mark removed]
Duh.
<?xml version="1.0" encoding="utf-8"?>
<!--export-->
<editionyear="2007">
That's not XML.
<film id="11">
<!--Bled Number One-->
<originalarticle />
<originaltitle>Bled Number One</originaltitle>
<englisharticle />
<englishtitle />
<useenglishtitle>False</useenglishtitle>
<premiere>Geen</premiere>
<productioncountry>Algeria,
France</productioncountry>
<productionyear>2006</productionyear>
<color>Kleur</color>
<format>35mm</format>
<screenratio>-</screenratio>
<lengthinminutes>100</lengthinminutes>
<credits>
<director>Ameur-Zaïmeche, Rabah</director>
<producers />
<sales>Les Films du Losange</sales>
<distributors>A-Film Distribution</distributors>
<scenario>Rabah Ameur-Zaïmeche, Louise
Thermes</scenario>
<photography>Lionel Sautier, Olivier Smittarello,
Hakim Si
Ahmed</photography>
<editor>Nicolas Bancilhon</editor>
<artdesign />
<sound>Timothee Alazraki, Bruno Auzet, Mohamed
Naman</sound>
<music>Rodolphe Burger</music>
<other />
<cast>Rabah Ameur-Zaïmeche, Meriem Serbah, Abel
Jafri, Farida
Ouchani, Ramzy Bedia</cast>
</credits>
<synopsis>
<short language="dutch" length="252">
<p>Fictie als een documentaire jamsessie. De
filmmaker speelt
zelf de hoofdrol van een crimineel die Frankrijk is
uitgezet en terug
moet naar zijn dorp in Algerije dat hij niet voor niets
ooit heeft
verlaten. Improviserend en met muzikaal gevoel gefilmd.
</p>
</short>
You just saved a few bytes of bandwidth and a few seconds
of your time by omitting the closing tags. By doing that,
you've also wasted several seconds of time for every person
who decided to try and help you. That's not very kind of
you. Not very smart, either.
Now I would like to just "read" the text. Is there a way
to turn XML automagically into something readable?
Not reliably. The default transformation does something
close to what you seem to be wanting:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
</xsl:stylesheet>

Stuff into default.xsl or somesuch, then add the following
processing instruction:

<?xml-stylesheet type="text/xsl" href="default.xsl"?>

after the XML declaration in your XML file.

If that isn't what you really need, ask your resident XML
expert to create a transformation for you.

--
Pavel Lepin

Dec 12 '06 #3
MartinC wrote:
I am no expert on the subject but some of my translation work is being
saved as XML files by a dotnet ap. Now I would like to just "read" the
text. Is there a way to turn XML automagically into something readable?
Like:
===============================
<?xml version="1.0" encoding="utf-8"?>
<!--export-->
<editionyear="2007">
First you have to correct this line to

<edition year="2007">

Then you can use a parser to verify well-formedness

xmllint --noout file.xml
Bled Number One
Algeria, France
2006
Color
35mm
Looks like you want some parts of the XML file to be
displayed and others to be ignored. I usually do such
kind of processing with xgawk. For example this script

http://home.vrweb.de/~juergen.kahrs/...character-sets

@load xml
XMLCHARDATA { printf $0 }

will print all character data (text) and ignore comments
and attributes. Maybe this helps you.
Dec 12 '06 #4
MartinC wrote:
I am no expert on the subject but some of my translation work is being
saved as XML files by a dotnet ap. Now I would like to just "read" the
text. Is there a way to turn XML automagically into something readable?
No, not automatically, unless someone has done it before for this type
of file and is prepared to let you have their code. XML documents
typically contain no information about how the text is to be used
(displayed, typeset, spoken, etc). You have to specify (in some
transformation language, eg XSLT) how each element is to be represented.
This isn't difficult, but it does mean learning how to do it, or
employing someone who does.

///Peter
--
XML FAQ: http://xml.silmaril.ie/
Dec 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: yogesh | last post by:
How to store the java applet emebedded in a web page for offline viewing? I saved the web page but it got saved without the applet.and also I searched for the corressponding .class file for the...
14
by: Brian Maupin | last post by:
I have a refreshing webcam shot on my site and I was wondering if there was a way I could display how many people are currently viewing it? Thanks in advance.
3
by: sss024 | last post by:
Word document viewing in RichTextBox control
3
by: Brooke | last post by:
How can I prevent a user from viewing the html code on a web page? e.g. right click->view source
10
by: NH | last post by:
I have a girdview with paging enabled. How can I add a message in the footer to say "Viewing records 1-15 of 45" etc Thanks
1
by: Jck | last post by:
Could someone let me know how to get the current top row in a datagrid that is viewing by the user please? I got a datagrid connected with a datatable with 5000 records. I can use the...
12
bartonc
by: bartonc | last post by:
Here's something cool that I just discovered (on IE7, I wonder about the others): I was viewing a long code block with some really long lines in it. Since the horizontal scroll bar was WAY of my...
3
by: tom.youdan | last post by:
Hi, I have created a database that is used to store contact information for NGO's accross India. It is simple in structure and I want a portion of the data to be viewable on the Internet. I...
2
by: harryvb | last post by:
hey guys i am coding for an accounting s/w in visual basic i am able to edit the data while viewing how do i disable editing the data while viewing
0
by: Deceneu | last post by:
Hi everyone, this is my first post so please bear with me. I have the following situation: i have a local report that needs to have two "versions": one for viewing in the report viewer (with all...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.