Retaining &ldquo;<&rdquo; while applying XSLT to an xml

spaz21

New Member
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 "\[code\]This <item name> belongs to me.\[/code\]"The output I get is "\[code\]This belongs to me.\[/code\]" <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 < and >. 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,SahityaP.S.-I am a newbie to xml handling and xsl as well.XML with the CData section: "\[code\]<descriptionText><![CDATA[This <item name> belongs to me.]]></descriptionText>\[/code\]"XSL excerpt: \[code\]<tr><td><xsl:value-of select="descriptionText" disable-output-escaping="yes"/></td></tr>\[/code\]expectedOutput: \[code\]This <item name> belongs to me.\[/code\]ActualOutput: \[code\]This belongs to me.\[/code\]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, \[code\]- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame;\[/code\] of the printer class, is called.Please see the implementation of this API below:\[code\]- (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];}\[/code\]
 
Back
Top