Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8185155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:44:49+00:00 2026-06-07T01:44:49+00:00

I am using the XML->XHTL conversion for printing a model based window. What I

  • 0

I am using the XML->XHTL conversion for printing a model based window.
What I do is to convert my model into a well formed xml. And then applying xsl to it.

A few attributes in my model have large text value. Occasionally this text may contain, “<” and “>”. Whenever such text appears, the text between “<” and “>” is skipped.
For example, if my text is “This <item name> belongs to me.”
The output I get is “This belongs to me.” <item name> is skipped. It looks like these characters in the attribute’s value are also identified as the beginning and end of xml tags. They get converted to &lt; and &gt;. And so the value is not printed.

Can anyone please tell me, how can i retain the angular brackets in the attribute’s value in output as well?
Any help is greatly appreciated.

Thanks,
Sahitya

P.S.-I am a newbie to xml handling and xsl as well.

XML with the CData section:
“<descriptionText><![CDATA[This <item name> belongs to me.]]></descriptionText>“

XSL excerpt:
<tr><td><xsl:value-of select="descriptionText" disable-output-escaping="yes"/></td></tr>

expectedOutput:
This <item name> belongs to me.

ActualOutput:
This belongs to me.

EDIT:

For implementing the print functionality at the application level, I am using the APIs of WebFrameLoadDelegate and NSPrintOperation.
Once the webview is created successfully, the delegate API,

- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame;

of the printer class, is called.
Please see the implementation of this API below:

- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
{
    NSPrintInfo *pi = [NSPrintInfo sharedPrintInfo];
    if ([NSPrintInfo defaultPrinter])
    {
        [pi setPrinter:[NSPrintInfo defaultPrinter]]; 
    }
    [pi setTopMargin:5.0];
    [pi setLeftMargin:5.0];
    [pi setBottomMargin:10.0];
    [pi setRightMargin:5.0];
    [pi setHorizontalPagination:NSFitPagination];
    [pi setVerticalPagination:NSFitPagination];
    [pi setVerticallyCentered:YES];
    [pi setHorizontallyCentered:YES];
    [[self.webView preferences] setAutosaves: NO];
    [[self.webView preferences] setShouldPrintBackgrounds:YES];
    NSPrintOperation *printOperation = [[[self.webView mainFrame] frameView] printOperationWithPrintInfo:pi];
    [printOperation runOperationModalForWindow:self.window delegate:self.delegate didRunSelector:self.callbackSelector contextInfo:nil];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:44:52+00:00Added an answer on June 7, 2026 at 1:44 am

    If you

    1. Wrap the text containing < and & in CDATA in your XML input
    2. Do not use disable-output-escaping

    Then the output of This <item name> belongs to me will be This &lt;item name&gt; belongs to me, which the browser will display correctly as This <item name> belongs to me.

    If you turn on disable-output-escaping, then the HTML generated will be This <item name> belongs to me, and the browser will think <item name> is an undefined HTML tag and skip over it, as you describe.

    Edit

    Here is a fully-functioning example:

    simple.xml (input)

    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet href="simple.xslt"?>
    <simple>
        <![CDATA[This <item name> belongs to me.]]>
    </simple>
    

    simple.xslt

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="/">
            <xsl:value-of select="."/>
        </xsl:template>
    </xsl:stylesheet>
    

    Output (when xml is opened in browser)

    This <item name> belongs to me.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using XML::XML2JSON in Perl to convert JSON data to XML, I am passing
I'm using XML::Simple to parse an XML file which I then want to use
I've been looking into examples of using XML and XSLT in JavaScript and I
By using XML API, I got date-time as 2008-02-05T12:50:00Z . Now I wanna convert
I am using xml-serialization in my project to serialize and deserialize objects based on
When using XML serialization in C#, I use code like this: public MyObject LoadData()
Been using XML for ages now for data storage & transfer, but have never
I am using xml serialization and de-serialization to read and write to an XML
I'm using XML Serialization heavily in a web service (the contracts pass complex types
I'm using XML for a config file in PHP (Using SimpleXML), in creating the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.