开发者

align="right" doesn't work in 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?


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.


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.


Plain XML? You need to apply a stylesheet to it, and that should be the part that identifies how to display the tag. Alignment is entirely part of display.

You can ask the browser (i.e., I've tested it with Safari and Firefox) to apply an XSLT stylesheet by adding a processing instruction to the XML document – usually immediately below the <?xml…?> declaration – which can do things like changing the document to XHTML (which can support alignment control):

<?xml-stylesheet type="text/xml" href="http://example.com/wherever.xsl"?>

You might also be able to get away with just telling the browser what to do by applying a CSS stylesheet:

<?xml-stylesheet type="text/css" href="http://example.com/wherever.css"?>

Ask further questions here if you need help learning how to use CSS, XSLT, or XHTML.


<Paragraph>
    <TextRuns>
        <TextRun>
             <Value>=Parameters!rpReportSubHead1.Value</Value>
             <Style>
                 <FontWeight>Normal</FontWeight>
             </Style>
        </TextRun>
    </TextRuns>
    <Style>
        <TextAlign>Right</TextAlign>
    </Style>
</Paragraph>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜