Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 202736 - CSL embedding does not work in XML documents
CSL embedding does not work in XML documents
Status: NEW
Product: xml
Classification: Unclassified
Component: Text-Edit
7.1
Macintosh Mac OS X
: P2 (vote)
: 7.2
Assigned To: Svata Dedic
issues@xml
: PERFORMANCE
Depends on: 203309
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-27 13:46 UTC by dbell
Modified: 2011-10-14 15:24 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
Sample project that attempts to embed CSS in XML (6.97 KB, application/x-gzip)
2011-09-28 01:07 UTC, dbell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dbell 2011-09-27 13:46:23 UTC
CSL languages embedded in XML documents do not have editor support (e.g. code completion, syntax highlighting). Please add the necessary CSL files to the XML mime lookup.

Partial Workaround:
I was able to enable code completion, occurrences marking, and hyperlinks in a CSL language embedded in XML by adding the following to the layer.xml :

<folder name="Editors">
        <folder name="text">
            <folder name="xml">
                <file name="org-netbeans-modules-csl-core-GsfParserFactory.instance">
                    <attr name="instanceOf" stringvalue="org.netbeans.modules.parsing.spi.ParserFactory"/>
                    <attr name="instanceCreate" methodvalue="org.netbeans.modules.csl.core.GsfParserFactory.create"/>
                </file>
                <file name="org-netbeans-modules-csl-editor-semantic-HighlightsLayerFactoryImpl.instance">
                    <attr name="instanceClass" stringvalue="org.netbeans.modules.csl.editor.semantic.HighlightsLayerFactoryImpl"/>
                    <attr name="instanceOf" stringvalue="org.netbeans.spi.editor.highlighting.HighlightsLayerFactory"/>
                </file>
                <folder name="HyperlinkProviders">
                    <file name="GsfHyperlinkProvider.instance">
                        <attr name="instanceClass" stringvalue="org.netbeans.modules.csl.editor.hyperlink.GsfHyperlinkProvider"/>
                        <attr name="instanceOf" stringvalue="org.netbeans.lib.editor.hyperlink.spi.HyperlinkProviderExt"/>
                    </file>    
                </folder>
                <folder name="CompletionProviders">
                    <file name="org-netbeans-modules-csl-editor-completion-GsfCompletionProvider.instance">
                        <attr name="instanceClass" stringvalue="org.netbeans.modules.csl.editor.completion.GsfCompletionProvider"/>
                    </file>
                </folder>
Comment 1 dbell 2011-09-28 01:07:26 UTC
Created attachment 111260 [details]
Sample project that attempts to embed CSS in XML

Added sample project that demonstrates embedding CSL language (CSS, in this case) in XML
Comment 2 Tomas Zezula 2011-09-29 07:26:24 UTC
The parsing.api correctly creates the embeddings in both Document and Source. Unfortunately the XML support does not provide CSL entry points so the support for embedded CSL base languages is not executed.

The layer patch provided by Daniel enables some CSL services in the XML support and makes the CSS to work.

Svato, before enabling the CSL in the XML please check a performance impact.
Comment 3 dbell 2011-10-07 13:51:10 UTC
Switched to P2, in accordance with BugPriorityGuidelines (http://wiki.netbeans.org/BugPriorityGuidelines).
Comment 4 Svata Dedic 2011-10-14 13:13:07 UTC
It does not work, since whole XML was not adapted to CSL at all (a small code reuse of isolated commenting feature makes XML editor dependent on CSL, but in fact CSL features are not used). 

I would strongly recommend to postpone this feature to 7.2. Some additional work on CSL is also planned, so XML could align with that within 7.2 release.
Comment 5 dbell 2011-10-14 15:03:08 UTC
(In reply to comment #4)
> It does not work, since whole XML was not adapted to CSL at all (a small code
> reuse of isolated commenting feature makes XML editor dependent on CSL, but in
> fact CSL features are not used). 
> 
> I would strongly recommend to postpone this feature to 7.2. Some additional
> work on CSL is also planned, so XML could align with that within 7.2 release.

That sounds reasonable. Is the plan to migrate XML to use CSL and the parsing API? Would you mind if I helped out with this feature for 7.2?
Comment 6 Svata Dedic 2011-10-14 15:15:55 UTC
Nothing is stoned until the release cycle starts; but the plan is to modularize CSL somewhat to allow its use piece by piece - see http://wiki.netbeans.org/CslModularization (just notes, in progress). If you feel like you could invest time into analysis, it would be great to have a list of XML features which COULD be replaced by CSL, or necessary adjustments (additions), which could enable the reuse.
The less redundant code we have in XML the better.
Comment 7 dbell 2011-10-14 15:24:53 UTC
(In reply to comment #6)
Sounds good. I'll write down what I've noticed so far, and have a look through some of the XML modules that I haven't used yet.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo