05-10-2008
I think you'd need '&;lt' for < and '&;gt' for > or something like that. you should do a google search on 'html encoding' should be the same for xml.
Quote:
Originally Posted by
ronix007
Hi,
I am getting problem in parsing special characters(Like &, > or <) in XML. I need to encode my C program and send in report format to another interface which is in XML format.
I do not know how to encode these special characters in C program before sending to XML format. Please help !!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have one file which is named ^? ( the DEL character )
I'd like to know how to rename or copy the file by using its i-node number
TYIA (2 Replies)
Discussion started by: nawnaw
2 Replies
2. Shell Programming and Scripting
When I open a file in vi, I see the following characters:
\302\240
Can someone explain what these characters mean. Is it ASCII format? I need to trim those characters from a file.
I am doing the following:
tr -d '\302\240'
---------- Post updated at 08:35 PM ---------- Previous... (1 Reply)
Discussion started by: sid1982
1 Replies
3. Shell Programming and Scripting
What is the shortest & right way to remove the string "" with a sed statement ?
echo 'whateverwhatever' | sed ........
? :) (2 Replies)
Discussion started by: ctsgnb
2 Replies
4. Shell Programming and Scripting
i need to replace the any special characters with escape characters like below.
test!=123-> test\!\=123
!@#$%^&*()-= to be replaced by
\!\@\#\$\%\^\&\*\(\)\-\= (8 Replies)
Discussion started by: laknar
8 Replies
5. AIX
Hi
I read xml files through mq and placed them on unix by using datastage as tool.
I can see some special characters infront of declaration part for every xml file i have produced.
below is the sample snippet when i opened the file by suing vi editor
^Z^E|^A^Z^Z<?xml version="1.0"... (1 Reply)
Discussion started by: dsdev_123
1 Replies
6. Shell Programming and Scripting
I am trying to parse the XML Google contact file using tools like xmllint and I even dived into the XSL Style Sheets using xsltproc but I get nowhere.
I can not supply any sample file as it contains private data but you can download your own contacts using this script:
#!/bin/sh
# imports... (9 Replies)
Discussion started by: ripat
9 Replies
7. Shell Programming and Scripting
Hi....I have a xml file which is having lots of special characters which I need to find out and put the distinct list of those into a text file. The list of special characters is not specific, it can be anything at different point of time.
Can anyone help me to find out the same and list out?
... (10 Replies)
Discussion started by: Krishanu Saha
10 Replies
8. Shell Programming and Scripting
Hi,
I am fairly new to unix scripting and recently tasked with some reporting scripts.
The reporting checks several batch jobs and this is quite iterative.
Now I am trying to minimize script effort and maximize reusability as there are only slight nuances in the repetitive tasks.
For... (3 Replies)
Discussion started by: joeniks
3 Replies
9. Shell Programming and Scripting
I want to parse a file containing special characters, below is a sample content of file
content of file :
Serial_no:1$$@#first_name:Rahane$$@last_name:Ajiyenke@@#profession:cricketer!@#*&^
Serial_no:1$$@#first_name:Rahane$$@last_name:Ajiyenke@@#profession:cricketer!@#*&^... (3 Replies)
Discussion started by: rajMjar
3 Replies
10. How to Post in the The UNIX and Linux Forums
Hi All,
I am trying to replace the values inside <password> tag in an xml file but it doesn't replace certain passwords:
For eg:
Server/home/sperinc>cat TextXML.txt
<appIds>
<entry name="AccountXref">
<type id="ldap">
<realm>nam</realm>
... (7 Replies)
Discussion started by: saroopkris85
7 Replies
LEARN ABOUT PHP
xml_parser_set_option
XML_PARSER_SET_OPTION(3) 1 XML_PARSER_SET_OPTION(3)
xml_parser_set_option - Set options in an XML parser
SYNOPSIS
bool xml_parser_set_option (resource $parser, int $option, mixed $value)
DESCRIPTION
Sets an option in an XML parser.
PARAMETERS
o $parser
- A reference to the XML parser to set an option in.
o $option
- Which option to set. See below. The following options are available:
XML parser options
+---------------------------+--------------------------------------+---+
| Option constant | | |
| | | |
| | Data type | |
| | | |
| | Description | |
| | | |
+---------------------------+--------------------------------------+---+
| | | |
| XML_OPTION_CASE_FOLDING | | |
| | | |
| | integer | |
| | | |
| | Controls whether case-folding is | |
| | enabled for this XML parser. Enabled | |
| | by default. | |
| | | |
| | | |
| XML_OPTION_SKIP_TAGSTART | | |
| | | |
| | integer | |
| | | |
| | Specify how many characters should | |
| | be skipped in the beginning of a tag | |
| | name. | |
| | | |
| | | |
| XML_OPTION_SKIP_WHITE | | |
| | | |
| | integer | |
| | | |
| | Whether to skip values consisting | |
| | of whitespace characters. | |
| | | |
| | | |
|XML_OPTION_TARGET_ENCODING | | |
| | | |
| | string | |
| | | |
| | Sets which target encoding to use | |
| | in this XML parser.By default, it is | |
| | set to the same as the source encod- | |
| | ing used by xml_parser_create(3). | |
| | Supported target encodings are | |
| | ISO-8859-1, US-ASCII and UTF-8. | |
| | | |
+---------------------------+--------------------------------------+---+
o $value
- The option's new value.
RETURN VALUES
This function returns FALSE if $parser does not refer to a valid parser, or if the option could not be set. Else the option is set and
TRUE is returned.
PHP Documentation Group XML_PARSER_SET_OPTION(3)