|
From: Ronald B. <rb...@rb...> - 2016-03-22 19:08:32
|
Please open an issue for that
On Tue, 22 Mar 2016 18:50:22 +0000 Fernando Alexandre Dias da Costa wrote:
>
>Hi y'all, I'm trying to parse CSS text containing a @Page rule in Java using CSSParser, but
it is raising a runtime error and ignoring it completely.
>
>The following piece of code ilustrates what I'm trying to do:
>
>public class Main {
> public static void main(String arg[]) throws IOException {
> String str = "@page rotated { size : landscape }";
> InputSource source = new InputSource(new StringReader(str));
> CSSOMParser parser = new CSSOMParser(new SACParserCSS3());
> CSSStyleSheet sheet = parser.parseStyleSheet(source, null, null);
> CSSRuleList rules = sheet.getCssRules();
> for (int index = 0; index < rules.getLength(); ++index) {
> CSSRule rule = rules.item(index);
> System.out.println(rule.getCssText());
> }
> }
>}
>
>Console Output:
>
>null [1:7] Error in @page rule. (Invalid token "rotated". Was expecting one of: <S>,
<LBRACE>, ":".)
>null [1:7] Ignoring the whole rule.
>
>Note: I suppressed import package declarations to make it shorter.
>
>According to W3C CSS validator the style "@page rotated { size : landscape }" is fine.
>
>This is an issue or CSSParser does not support this feature?
>
>Best regards.
>
>Fernando A. Dias da Costa
>
>
>
>-
>
>
>"Esta mensagem do SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO),
empresa pública federal regida pelo disposto na Lei Federal n? 5.615, é enviada
exclusivamente a seu destinatário e pode conter informaç?es confidenciais,
>protegidas por sigilo profissional. Sua utilizaç?o desautorizada é ilegal e sujeita o infrator
?s penas da lei. Se voc? a recebeu indevidamente, queira, por gentileza, reenviá-la ao
emitente, esclarecendo o equívoco."
>
>"This message from SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO) -- a
government company established under Brazilian law (5.615/70) -- is directed
exclusively to its addressee and may contain confidential data, protected
>under professional secrecy rules. Its unauthorized use is illegal and may subject the
transgressor to the law's penalties. If you're not the addressee, please send it back,
elucidating the failure."
>
>
>
>----< Inline text [text-plain-04.txt] >------------------
>
>-----------------------------------------------------------------------
-------
>Transform Data into Opportunity.
>Accelerate data analysis in your applications with
>Intel Data Analytics Acceleration Library.
>Click to learn more.
>http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
>
>
>----< Inline text [text-plain-05.txt] >------------------
>
>_______________________________________________
>cssparser-developers mailing list
>css...@li...
>https://lists.sourceforge.net/lists/listinfo/cssparser-developers
>
>
|