Merge lp:~zorba-coders/zorba/bug867156-importsegfaults into lp:zorba

Proposed by Cezar Andrei
Status: Superseded
Proposed branch: lp:~zorba-coders/zorba/bug867156-importsegfaults
Merge into: lp:zorba
Diff against target: 26 lines (+8/-1)
1 file modified
src/compiler/translator/translator.cpp (+8/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug867156-importsegfaults
Reviewer Review Type Date Requested Status
Matthias Brantner Needs Fixing
Cezar Andrei Approve
Chris Hillery Pending
Review via email: mp+103169@code.launchpad.net

This proposal has been superseded by a proposal from 2012-04-23.

Description of the change

According to Xerces-C++ team( http://issues.apache.org/jira/browse/XERCESC-1980 ) XMLSchema.xsd i.e. schema4schema should be avoided to be imported. This fix avoids importing this schema file.

To post a comment you must log in.
Revision history for this message
Cezar Andrei (cezar-andrei) :
review: Approve
Revision history for this message
Chris Hillery (ceejatec) wrote :

Could you add a URL in the code comment pointing to a Xerces mailing list
discussion or other page where it is mentioned that you shouldn't import
schema for schema? I suspect that is something that will surprise anyone
who looks at the Zorba source code later, so it would be good to have
third-party confirmation.

Ceej
aka Chris Hillery
On Apr 23, 2012 1:48 PM, "Cezar Andrei" <email address hidden> wrote:

> The proposal to merge lp:~zorba-coders/zorba/bug867156-importsegfaults
> into lp:zorba has been updated.
>
> Status: Needs review => Approved
>
> For more details, see:
>
> https://code.launchpad.net/~zorba-coders/zorba/bug867156-importsegfaults/+merge/103169
> --
>
> https://code.launchpad.net/~zorba-coders/zorba/bug867156-importsegfaults/+merge/103169
> You are requested to review the proposed merge of
> lp:~zorba-coders/zorba/bug867156-importsegfaults into lp:zorba.
>

10787. By Cezar Andrei <email address hidden>

Added a comment with link to Xecres-C++ bug.

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

There are already plenty of definitions for the XMLSchema URI. I think it would make sense to reuse the one from src/zorbamisc/ns_consts.h.

review: Needs Fixing

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp 2012-04-23 10:46:38 +0000
+++ src/compiler/translator/translator.cpp 2012-04-23 20:45:24 +0000
@@ -105,7 +105,7 @@
105105
106106
107#define NODE_SORT_OPT107#define NODE_SORT_OPT
108108#define XS_URI "http://www.w3.org/2001/XMLSchema"
109109
110namespace zorba110namespace zorba
111{111{
@@ -2011,6 +2011,13 @@
2011 theSctx->bind_ns(pfx, targetNS, loc, err::XQST0033);2011 theSctx->bind_ns(pfx, targetNS, loc, err::XQST0033);
2012 }2012 }
20132013
2014 zstring xsdTNS = zstring(XS_URI);
2015 if ( xsdTNS.compare(targetNS)==0 )
2016 {
2017 // Xerces doesn't like importing XMLSchema.xsd schema4schema, so we skip it
2018 return no_state;
2019 }
2020
2014 store::Item_t targetNSItem = NULL;2021 store::Item_t targetNSItem = NULL;
2015 zstring tmp = targetNS;2022 zstring tmp = targetNS;
2016 ITEM_FACTORY->createAnyURI(targetNSItem, tmp);2023 ITEM_FACTORY->createAnyURI(targetNSItem, tmp);

Subscribers

People subscribed via source and target branches