problem with <br /> being converted to <br>

xml

    Next

  • 1. Problem getting latin characters
    I have a byte array that contains xml encoded with UTF-8 encoding. This array contains this character sequence: C3 A0 C3 A8 C3 AC C3 B2 C3 B9 I know that this is equal to . How can I load this byte array in a Document and get correct sequence? I'm using VC++ 6.0 and msxml 4.0. Thanks NL
  • 2. use of the "default" attribute in XML Schema Element
    Hi all, what is the correct use of the "default" attribute in XML Schema? For example: <xs:element name="myProperty" type="xs:string" default="myDefaultValue"/> What can I do with it? What is the meaning of < ...default="myDefaultValue" /> ? Thank you so much. Bye
  • 3. Data Binding Events
    We're using XML tabular data binding on a webpage. I've seen the data island events onreadystatechange, ondatasetcomplete and onrowentered. However, we need to do some Javascript processing preferably AFTER the tabular rows have been populated. Are there any events (a handler can hook up to) which indicate that (1) a new row is being created due to the synchronisation data island <-> tabular binding (NOT due to a new row being inserted manually/programmatically) (2) the bound fields have been populated, i.e. the myInputfield.value is available My current understanding is: onreadystatechange (data island XML is loading) => ondatasetcomplete (XML has been loaded and parsed, but tabular binding is not yet synchronized => tabular rows are created and populated (events???) Thanks Simon

Re: problem with <br /> being converted to <br>

Postby Alfons » Sat, 02 Aug 2003 05:33:42 GMT

add to your xsl file a sentence like this :
<xsl:for-each select="object">
<xsl:if test="@type='text'">
<textarea><xsl:apply-templates/></textarea>
</xsl:if>
</xsl:for-each>
.....
<xsl:template match="*/br">
 <br/>
</xsl:template>
<xsl:template match="text()"><xsl:value-of/></xsl:template>


"Duwayne" < XXXX@XXXXX.COM > escribien el mensaje


>> I have a xml like so...
>>
>><
>><
>><
>><
>>
>> the conversion:
>>
>><blah blah bla<blah blah bla<
>>
>> How do I do it such that it does not convert the<
to<

Re: problem with <br /> being converted to <br>

Postby Duwayne Sy » Sat, 02 Aug 2003 06:31:55 GMT

I guess there is no way to say.. give me everything between
<object type='text'></object> without the parser manupulating it. Reason
for this is because someone might put a differnt tag that looks like <br
/> and I have no control over it.

*** Sent via Developersdex  http://www.**--****.com/  ***
Don't just participate in USENET...get rewarded for it!

Similar Threads:

1.Replacing <br></br> to <br />

2.Xsl with <br/> problem

Hi,

I am having a small problem, that is driving me nuts.
My application reads some Xml and runs 2 Xsl Transformations to generate 
HTML. As soon as my second XSL introduces some <br/> tags, the application 
crashes with the same error message I would get when writing <br> and no 
closing tag. To make everything a little stranger, even <br></br> seems to 
be bad while <lbr/> is fine. Ive tried some other tag names and the problem 
only appears with br-tags ... any ideas?

Regards,
    Chris 



3.InnerXml "<Table><AREA_CODE>707</AREA_CODE><TIME_ZONE>P</TIME_ZONE></Table>"

how do I parse this System.Xml.Xmlnode to get the value 'P' within the 
element <TIME_ZONE> ?

Thank you,  -hazz 


4.<br/> turns to <br>

5.Replace <nl></bl> with <br />

"Bernhard Sturm" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
:
: Hi Group
: This is something that bothered me quite for a long time. I have googled
: for this problem, but so far couldn't find a solution. I am an absolute
: beginner concerning XSL(T), but I have a problem with an XML file of the
: following structure:
:
: <section>
: <subsection>
: <number>1
: </number>
: <text>This is my text<nl></nl>This is a new line
: </text>
: </subsection>
: </section>
:
: Now.. I am trying to transform the <nl></nl> via an XSL into a <br />
: (my output will be XHTML)... All I've found so far is that I might have
: to use a recursively template with xsl:copy, but I couldn't figure out
: how to apply this (or to include the recursive template into my already
: existing XSL template structure as my XSL is converting perfectly the
: XML so far, but without the <nl></nl>, they are just being ignored...)
:
: Any help to this?

Sure.  You merely need to define a template that transforms "nl" elements to
"br" elements:

   <xsl:template match="nl">
      <br/>
   </xsl:template>

Then, whenever templates are applied to nodes that contain "nl" elements,
they'll get transformed.

Here's a simple stylesheet that uses the identity transform to copy
everything identically except for nl elements:

   <xsl:template match="node()|@*">
      <xsl:copy>
         <xsl:apply-templates select="node()|@*"/>
      </xsl:copy>
   </xsl:template>
   <xsl:template match="nl">
      <br/>
   </xsl:template>

Hope this helps.

Bob Rossney
 XXXX@XXXXX.COM 


6. REXML element reading <br /> error

7. XPath querying text node *including* <br/>

8. CDATA's \n to <BR>



Return to xml

 

Who is online

Users browsing this forum: No registered users and 28 guest