Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

align="right" doesn't work in XML

Tags:

xml

I've never used XML before, and now I must change the align of text. I try to do it like in HTML, but it doesn't happen. Maybe I do something wrong? Here is he script:

<gallery>
    <title><![CDATA[<FONT SIZE="20" COLOR="#C3A25D"></FONT>]]></title>
    <text><![CDATA[<FONT SIZE="20" COLOR="#C3A25D">text, which i want to to be in right position</FONT>]]></text>
    <thmb></thmb>
    <img wdt="421">images/avetiskhakhamyan.jpg</img>
</gallery>

I try to write align="right" in <font> tag, but it deosn't work. Could you tell me what is the problem?

Update:

And I can't understand anyway, if I don't set any align attribute, why it show text in center? is it the default value?

like image 803
Simon Avatar asked Mar 22 '26 04:03

Simon


2 Answers

XML is not a display format. It doesn't not "understand" alignments.

As far as XML is concerned, align="right" is an attribute named align with the value right. Noting more and nothing less.

like image 114
Oded Avatar answered Mar 24 '26 21:03

Oded


XML exists purely to describe and contain data. Presentation (colors, positioning, fonts etc.) is not part of what XML can or should be able to do.

You should take a look at XLST (and therefore too HTML and CSS). That way you can format your data the way you want.

like image 43
Arve Systad Avatar answered Mar 24 '26 21:03

Arve Systad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!