Sponsored Content
Top Forums UNIX for Beginners Questions & Answers General Purpose XML Processing Post 303026310 by bakunin on Saturday 24th of November 2018 02:46:05 AM
Old 11-24-2018
Quote:
Originally Posted by rahuldaso
what is the main difference beetween html and xml?
XML is the principle of using markup - "tags" - to denote special parts of a text put into a standardised format: tags are denoted "<tagname>", etc.. (there would be other ways of marking up text, like:

Code:
This is normal text [italic=on]but[italic=off] the last word was different.

which is also using the markup-principle but is not XML.)

HTML is one very specific variety of XML, with a fixed set of tags that can occur and a fixed order of tags that have to be there:

Code:
<body>....</body>
<head>....</head>

would be an error in HTML because the head-tag has to come before the body-tag. In XML this would be perfectly OK because there is no such rule. In fact there is no list of tags which are allowed and no prescribed structure they are allowed to have like there is in HTML.

So, in short: every HTML text is a valid XML text too, but not every XML has to be calid HTML.

I hope this helps.

bakunin
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Looking for a general purpose System Monitor

Does anyone have any scripts or suggestions on a general purpose Unix/Linux monitoring tool? (5 Replies)
Discussion started by: darthur
5 Replies

2. Shell Programming and Scripting

need help on xml processing

I am trying to divide a xml file(my.xml) like this: <?xml version="1.0" encoding="UTF-8"?> <Proto PName="hmmmmmmm"> <Menu id="A" ver="1"> <P> <P name="AA" Type="X"/> <P name="BB" Type="Y"/> <P name="CC" Type="Z"/> </P> ... (4 Replies)
Discussion started by: demoprog
4 Replies

3. Shell Programming and Scripting

CSV processing to XML

Hi, i am really fresh with shell scripting and programming, i have an issue i am not able to solve to populate data on my server for Cisco IP phones. I have CSV file within the following format: ;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;... (9 Replies)
Discussion started by: angel2008
9 Replies

4. Programming

help me with perl script xml processing

Hi everyone, I have Xml files in a folder, I need to extract some attribute values form xml files and store in a hash. My xml file look like this. <?xml version="1.0" encoding="UTF-8"?> <Servicelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"... (0 Replies)
Discussion started by: pavani reddy
0 Replies

5. Shell Programming and Scripting

Help with XML file processing

I need to get all session_ID 's for product="D-0002" from a XML file: Sample input: <session session_ID="6411206" create_date="2012-04-10-10.22.13.000000"> <marketing_info> <program_id>D4AWFU</program_id> <subchannel_id>abc</subchannel_id> </marketing_info> ... (1 Reply)
Discussion started by: karumudi7
1 Replies

6. Shell Programming and Scripting

processing xml with awk

With the following input sample extracted from a xml file <rel ver="123"> <mod name="on"> <node env="ac" env="1"> <ins ip="10.192.0.1"/> <ins ip="10.192.0.2"/> ... (1 Reply)
Discussion started by: cabrao
1 Replies

7. UNIX for Beginners Questions & Answers

General Purpose Date Script

There must be thousands of one-off solutions scattered around this forum. GNU Date is so handy because it's general but if they're asking they probably don't have it. We have some nice scripts but they tend to need dates formatted in a very particular way. This is a rough approximation which... (18 Replies)
Discussion started by: Corona688
18 Replies
Parser::Style::Stream(3)				User Contributed Perl Documentation				  Parser::Style::Stream(3)

NAME
XML::Parser::Style::Stream - Stream style for XML::Parser SYNOPSIS
use XML::Parser; my $p = XML::Parser->new(Style => 'Stream', Pkg => 'MySubs'); $p->parsefile('foo.xml'); { package MySubs; sub StartTag { my ($e, $name) = @_; # do something with start tags } sub EndTag { my ($e, $name) = @_; # do something with end tags } sub Characters { my ($e, $data) = @_; # do something with text nodes } } DESCRIPTION
This style uses the Pkg option to find subs in a given package to call for each event. If none of the subs that this style looks for is there, then the effect of parsing with this style is to print a canonical copy of the document without comments or declarations. All the subs receive as their 1st parameter the Expat instance for the document they're parsing. It looks for the following routines: * StartDocument Called at the start of the parse . * StartTag Called for every start tag with a second parameter of the element type. The $_ variable will contain a copy of the tag and the %_ vari- able will contain attribute values supplied for that element. * EndTag Called for every end tag with a second parameter of the element type. The $_ variable will contain a copy of the end tag. * Text Called just before start or end tags with accumulated non-markup text in the $_ variable. * PI Called for processing instructions. The $_ variable will contain a copy of the PI and the target and data are sent as 2nd and 3rd parameters respectively. * EndDocument Called at conclusion of the parse. perl v5.8.4 2003-08-18 Parser::Style::Stream(3)
All times are GMT -4. The time now is 02:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy