Project

Profile

Help

problem with linebreaks after attributes

Added by Anonymous almost 17 years ago

Legacy ID: #4671560 Legacy Poster: Starbuck (starbuck82)

Hello Everybody, I want to transform an XMI Document (XML exchange format for UML) in an SVG Document by using XSL and the Saxon XSLT Processor. I have a problem with linebreaks (or whitespaces) after attributes. If a Element is longer than the line, each attribute will separate in a new line. But my target plattform can't handle the linebreaks after the attributes. So I need a way to suppress the linebreaks. Here is a example for the problematic output: <library xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.mldesigner.com/mld" gid="_7ccsEJgkEdyeXNcvzS14Kw" name="Libname" version="2.7.r00"> And this is the associated XSL Code <?xml version='1.0'?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/xpath-functions" exclude-result-prefixes="fn xmi uml"> <xsl:output method="xml" encoding="ISO-8859-1" indent="yes" use-character-maps="sonderzeichen"/> <xsl:param name="library_name" select="defaultwert"/> <xsl:template match="//uml:Model"> <library gid="{@xmi:id}" name="{$library_name}" version="2.7.r00" xmlns="http://www.mldesigner.com/mld" xmlns:svg="http://www.w3.org/2000/svg"> .... I tried to set indent="no" in xsl:output but I need the linebreaks after the elements, so it doesn't work for me. Thank you in advance. Greetings Starbuck


Replies (1)

RE: problem with linebreaks after attributes - Added by Anonymous almost 17 years ago

Legacy ID: #4672649 Legacy Poster: Michael Kay (mhkay)

You need to raise a bug report on the application that is processing the XML. The whole purpose of XML is frustrated if applications don't implement the standards correctly; and the only solution to such problems is to fix the application that is broken. Newlines are allowed between attributes and any respectable XML parser will accept them. I'm afraid that using indent="no" is the only possible workaround. If the XML that this produces isn't accepted by the receiving application either, then you really should be asking for your money back.

    (1-1/1)

    Please register to reply