You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2011/08/18 20:51:32 UTC

[jira] [Commented] (JENA-103) FmtUtils does not expand xsd prefix

    [ https://issues.apache.org/jira/browse/JENA-103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13087192#comment-13087192 ] 

Andy Seaborne commented on JENA-103:
------------------------------------

It uses a standard built in prefix mapping to abbreviate URIs for various toString() support.

Use FmtUtils#stringForNode(node, (PrefixMapping)null) for raw URI output.

FmtUtils fulfills 2 roles - convenience operations and a place for all nod formatting logic.  The difefrences aren't documented because I've always been meaning to rework all output to avoid "format to string, write string".

FmtUtils is old code that needs rewriting to use streaming - NodeFmtLib is the intended replacement.  OutputLangUtils is for a general collection of print things.  But all this is unfinished.



> FmtUtils does not expand xsd prefix
> -----------------------------------
>
>                 Key: JENA-103
>                 URL: https://issues.apache.org/jira/browse/JENA-103
>             Project: Jena
>          Issue Type: Bug
>          Components: ARQ
>         Environment: *
>            Reporter: Laurent Pellegrino
>            Priority: Minor
>              Labels: FmtUtils, arq
>
> A call to FmtUtils#stringForNode(literalNode) with literalNode equals to Node.createLiteral("9", null, XSDDatatype.XSDint) returns "9"^^xsd:int whereas "9"^^http://www.w3.org/2001/XMLSchema#int is expected.
> I have set the issue as minor because it is currently possible to solve the issue by using the new OutputLangUtils class which returns the right value. However this imply to write several lines to get the output as a String:
>     StringWriter sw = new StringWriter();
>     OutputLangUtils.output(sw, object, null);
>     new String(sw.getBuffer());
> Maybe, a solution would be to rewrite FmtUtils by using OutputLangUtils? Thus, FmtUtils will be useful to format Nodes as String and only OutputLangUtils has to be maintained.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira