--- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_List.java 2016-08-25 15:12:05.427844025 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_List.java 2016-08-25 15:12:05.343842500 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,21 +25,16 @@ /* this file is generated by RelaxNGCC */ package com.sun.xml.internal.xsom.impl.parser.state; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.Attributes; -import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; - import com.sun.xml.internal.xsom.*; - import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.impl.*; - import com.sun.xml.internal.xsom.impl.parser.*; - import org.xml.sax.Locator; - import org.xml.sax.ContentHandler; - import org.xml.sax.helpers.*; - import java.util.*; - import java.math.BigInteger; +import com.sun.xml.internal.bind.WhiteSpaceProcessor; +import com.sun.xml.internal.xsom.impl.*; +import com.sun.xml.internal.xsom.impl.parser.*; +import com.sun.xml.internal.xsom.parser.*; +import java.util.*; +import org.xml.sax.Attributes; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; class SimpleType_List extends NGCCHandler { @@ -336,8 +331,9 @@ break; case 5: { + // -> with attribute 'itemType' = $value NGCCHandler h = new qname(this, super._source, $runtime, 260); - spawnChildFromText(h, $value); + spawnChildFromText(h, WhiteSpaceProcessor.collapse($value)); } break; } --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Restriction.java 2016-08-25 15:12:05.799850782 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Restriction.java 2016-08-25 15:12:05.715849256 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,20 +25,18 @@ /* this file is generated by RelaxNGCC */ package com.sun.xml.internal.xsom.impl.parser.state; + import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; import org.xml.sax.Attributes; import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; +import com.sun.xml.internal.bind.WhiteSpaceProcessor; - import com.sun.xml.internal.xsom.*; - import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.impl.*; - import com.sun.xml.internal.xsom.impl.parser.*; - import org.xml.sax.Locator; - import org.xml.sax.ContentHandler; - import org.xml.sax.helpers.*; - import java.util.*; - import java.math.BigInteger; +import com.sun.xml.internal.xsom.*; +import com.sun.xml.internal.xsom.parser.*; +import com.sun.xml.internal.xsom.impl.*; +import com.sun.xml.internal.xsom.impl.parser.*; +import org.xml.sax.Locator; +import java.util.*; @@ -383,8 +381,9 @@ switch($_ngcc_current_state) { case 8: { + // -> with attribute 'base' = $value NGCCHandler h = new qname(this, super._source, $runtime, 160); - spawnChildFromText(h, $value); + spawnChildFromText(h, WhiteSpaceProcessor.collapse($value)); } break; case 12: --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Union.java 2016-08-25 15:12:06.123856666 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Union.java 2016-08-25 15:12:06.039855140 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,22 +25,15 @@ /* this file is generated by RelaxNGCC */ package com.sun.xml.internal.xsom.impl.parser.state; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.Attributes; -import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; - import com.sun.xml.internal.xsom.*; - import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.impl.*; - import com.sun.xml.internal.xsom.impl.parser.*; - import org.xml.sax.Locator; - import org.xml.sax.ContentHandler; - import org.xml.sax.helpers.*; - import java.util.*; - import java.math.BigInteger; +import com.sun.xml.internal.xsom.impl.*; +import com.sun.xml.internal.xsom.impl.parser.*; +import com.sun.xml.internal.xsom.parser.*; -import java.util.Vector; +import java.util.*; +import org.xml.sax.Attributes; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; class SimpleType_Union extends NGCCHandler { @@ -360,6 +353,8 @@ break; case 9: { + // -> with first type in 'memberTypes' attribute is $value + // Whitespaces in types list are collapsed and there is no need to handle it here NGCCHandler h = new qname(this, super._source, $runtime, 187); spawnChildFromText(h, $value); } @@ -390,6 +385,8 @@ break; case 8: { + // -> with additional type in 'memberTypes' attribute is $value + // Whitespaces in types list are collapsed and there is no need to handle it here NGCCHandler h = new qname(this, super._source, $runtime, 188); spawnChildFromText(h, $value); } --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeDeclBody.java 2016-08-25 15:12:06.467862914 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeDeclBody.java 2016-08-25 15:12:06.367861098 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,20 +25,16 @@ /* this file is generated by RelaxNGCC */ package com.sun.xml.internal.xsom.impl.parser.state; + +import com.sun.xml.internal.bind.WhiteSpaceProcessor; import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; import org.xml.sax.Attributes; import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; - import com.sun.xml.internal.xsom.*; - import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.impl.*; - import com.sun.xml.internal.xsom.impl.parser.*; - import org.xml.sax.Locator; - import org.xml.sax.ContentHandler; - import org.xml.sax.helpers.*; - import java.util.*; - import java.math.BigInteger; +import com.sun.xml.internal.xsom.parser.*; +import com.sun.xml.internal.xsom.impl.*; +import com.sun.xml.internal.xsom.impl.parser.*; +import org.xml.sax.Locator; @@ -458,14 +454,16 @@ break; case 11: { - name = $value; + // with attribute 'name' = $value + name = WhiteSpaceProcessor.collapse($value); $_ngcc_current_state = 10; } break; case 5: { + // with attribute 'type' = $value NGCCHandler h = new qname(this, super._source, $runtime, 381); - spawnChildFromText(h, $value); + spawnChildFromText(h, WhiteSpaceProcessor.collapse($value)); } break; } --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeGroupDecl.java 2016-08-25 15:12:06.787868727 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeGroupDecl.java 2016-08-25 15:12:06.703867201 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,20 +25,15 @@ /* this file is generated by RelaxNGCC */ package com.sun.xml.internal.xsom.impl.parser.state; + +import com.sun.xml.internal.bind.WhiteSpaceProcessor; import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; import org.xml.sax.Attributes; import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; - import com.sun.xml.internal.xsom.*; - import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.impl.*; - import com.sun.xml.internal.xsom.impl.parser.*; - import org.xml.sax.Locator; - import org.xml.sax.ContentHandler; - import org.xml.sax.helpers.*; - import java.util.*; - import java.math.BigInteger; +import com.sun.xml.internal.xsom.parser.*; +import com.sun.xml.internal.xsom.impl.*; +import org.xml.sax.Locator; @@ -401,7 +396,8 @@ break; case 12: { - name = $value; + // with attribute 'name' = $value + name = WhiteSpaceProcessor.collapse($value); $_ngcc_current_state = 11; } break; --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeUses.java 2016-08-25 15:12:07.135875047 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeUses.java 2016-08-25 15:12:07.039873304 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,20 +25,15 @@ /* this file is generated by RelaxNGCC */ package com.sun.xml.internal.xsom.impl.parser.state; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.Attributes; -import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; - import com.sun.xml.internal.xsom.*; - import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.impl.*; - import com.sun.xml.internal.xsom.impl.parser.*; - import org.xml.sax.Locator; - import org.xml.sax.ContentHandler; - import org.xml.sax.helpers.*; - import java.util.*; - import java.math.BigInteger; +import com.sun.xml.internal.bind.WhiteSpaceProcessor; +import com.sun.xml.internal.xsom.impl.*; +import com.sun.xml.internal.xsom.impl.parser.*; +import com.sun.xml.internal.xsom.parser.*; + +import org.xml.sax.Attributes; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; @@ -826,8 +821,9 @@ break; case 22: { + // with attribute 'ref' = $value NGCCHandler h = new qname(this, super._source, $runtime, 311); - spawnChildFromText(h, $value); + spawnChildFromText(h, WhiteSpaceProcessor.collapse($value)); } break; case 29: @@ -844,8 +840,9 @@ break; case 12: { + // with attribute 'ref' = $value NGCCHandler h = new qname(this, super._source, $runtime, 300); - spawnChildFromText(h, $value); + spawnChildFromText(h, WhiteSpaceProcessor.collapse($value)); } break; case 35: --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/complexType.java 2016-08-25 15:12:07.467881077 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/complexType.java 2016-08-25 15:12:07.383879552 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,20 +25,17 @@ /* this file is generated by RelaxNGCC */ package com.sun.xml.internal.xsom.impl.parser.state; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.Attributes; -import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; - import com.sun.xml.internal.xsom.*; - import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.impl.*; - import com.sun.xml.internal.xsom.impl.parser.*; - import org.xml.sax.Locator; - import org.xml.sax.ContentHandler; - import org.xml.sax.helpers.*; - import java.util.*; - import java.math.BigInteger; +import com.sun.xml.internal.bind.WhiteSpaceProcessor; +import com.sun.xml.internal.xsom.*; +import com.sun.xml.internal.xsom.impl.*; +import com.sun.xml.internal.xsom.impl.parser.*; +import com.sun.xml.internal.xsom.parser.*; + +import java.util.*; +import org.xml.sax.Attributes; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; @@ -1481,8 +1478,10 @@ switch($_ngcc_current_state) { case 58: { + // -> -> with + // attribute 'base' = $value NGCCHandler h = new qname(this, super._source, $runtime, 621); - spawnChildFromText(h, $value); + spawnChildFromText(h, WhiteSpaceProcessor.collapse($value)); } break; case 54: @@ -1645,8 +1644,10 @@ break; case 43: { + // -> -> with + // attribute 'base' = $value NGCCHandler h = new qname(this, super._source, $runtime, 601); - spawnChildFromText(h, $value); + spawnChildFromText(h, WhiteSpaceProcessor.collapse($value)); } break; case 39: @@ -1665,8 +1666,10 @@ break; case 23: { + // -> -> with + // attribute 'base' = $value NGCCHandler h = new qname(this, super._source, $runtime, 577); - spawnChildFromText(h, $value); + spawnChildFromText(h, WhiteSpaceProcessor.collapse($value)); } break; case 52: @@ -1683,7 +1686,8 @@ break; case 70: { - name = $value; + // with attribute 'name' = $value + name = WhiteSpaceProcessor.collapse($value); $_ngcc_current_state = 69; } break; @@ -1719,8 +1723,10 @@ break; case 14: { + // -> -> with + // attribute 'base' = $value NGCCHandler h = new qname(this, super._source, $runtime, 566); - spawnChildFromText(h, $value); + spawnChildFromText(h, WhiteSpaceProcessor.collapse($value)); } break; } --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/elementDeclBody.java 2016-08-25 15:12:07.819887471 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/elementDeclBody.java 2016-08-25 15:12:07.735885945 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,20 +25,17 @@ /* this file is generated by RelaxNGCC */ package com.sun.xml.internal.xsom.impl.parser.state; + import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; import org.xml.sax.Attributes; +import com.sun.xml.internal.bind.WhiteSpaceProcessor; import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; - import com.sun.xml.internal.xsom.*; - import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.impl.*; - import com.sun.xml.internal.xsom.impl.parser.*; - import org.xml.sax.Locator; - import org.xml.sax.ContentHandler; - import org.xml.sax.helpers.*; - import java.util.*; - import java.math.BigInteger; +import com.sun.xml.internal.xsom.parser.*; +import com.sun.xml.internal.xsom.impl.*; +import com.sun.xml.internal.xsom.impl.parser.*; +import org.xml.sax.Locator; +import java.util.*; @@ -813,7 +810,8 @@ break; case 22: { - name = $value; + // with attribute 'name' = $value + name = WhiteSpaceProcessor.collapse($value); $_ngcc_current_state = 21; } break; @@ -848,8 +846,9 @@ break; case 6: { + // with attribute 'type' = $value NGCCHandler h = new qname(this, super._source, $runtime, 10); - spawnChildFromText(h, $value); + spawnChildFromText(h, WhiteSpaceProcessor.collapse($value)); } break; case 24: @@ -1002,8 +1001,9 @@ break; case 15: { + // -> with attribute 'substitutionGroup' = $value NGCCHandler h = new qname(this, super._source, $runtime, 27); - spawnChildFromText(h, $value); + spawnChildFromText(h, WhiteSpaceProcessor.collapse($value)); } break; case 26: --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/group.java 2016-08-25 15:12:08.167893792 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/group.java 2016-08-25 15:12:08.071892048 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,20 +25,15 @@ /* this file is generated by RelaxNGCC */ package com.sun.xml.internal.xsom.impl.parser.state; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.Attributes; + +import com.sun.xml.internal.bind.WhiteSpaceProcessor; +import com.sun.xml.internal.xsom.impl.*; import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; +import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.*; - import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.impl.*; - import com.sun.xml.internal.xsom.impl.parser.*; - import org.xml.sax.Locator; - import org.xml.sax.ContentHandler; - import org.xml.sax.helpers.*; - import java.util.*; - import java.math.BigInteger; +import org.xml.sax.Attributes; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; @@ -403,7 +398,8 @@ break; case 9: { - name = $value; + // with attribute 'name' = $value + name = WhiteSpaceProcessor.collapse($value); $_ngcc_current_state = 8; } break; --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/identityConstraint.java 2016-08-25 15:12:08.539900548 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/identityConstraint.java 2016-08-25 15:12:08.431898586 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,22 +23,18 @@ * questions. */ -/* this file is generated by RelaxNGCC */ + /* this file is generated by RelaxNGCC */ package com.sun.xml.internal.xsom.impl.parser.state; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.Attributes; -import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; - import com.sun.xml.internal.xsom.*; - import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.impl.*; - import com.sun.xml.internal.xsom.impl.parser.*; - import org.xml.sax.Locator; - import org.xml.sax.ContentHandler; - import org.xml.sax.helpers.*; - import java.util.*; - import java.math.BigInteger; +import com.sun.xml.internal.bind.WhiteSpaceProcessor; +import com.sun.xml.internal.xsom.*; +import com.sun.xml.internal.xsom.impl.*; +import com.sun.xml.internal.xsom.impl.parser.*; +import com.sun.xml.internal.xsom.parser.*; + +import java.util.*; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; @@ -471,7 +467,8 @@ switch($_ngcc_current_state) { case 15: { - name = $value; + // or or with attribute 'name' = $value + name = WhiteSpaceProcessor.collapse($value); $_ngcc_current_state = 14; } break; @@ -490,8 +487,9 @@ break; case 12: { + // with attribute 'refer' = $value NGCCHandler h = new qname(this, super._source, $runtime, 280); - spawnChildFromText(h, $value); + spawnChildFromText(h, WhiteSpaceProcessor.collapse($value)); } break; case 17: --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/notation.java 2016-08-25 15:12:08.895907014 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/notation.java 2016-08-25 15:12:08.811905489 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,20 +25,16 @@ /* this file is generated by RelaxNGCC */ package com.sun.xml.internal.xsom.impl.parser.state; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.Attributes; + +import com.sun.xml.internal.bind.WhiteSpaceProcessor; +import com.sun.xml.internal.xsom.*; +import com.sun.xml.internal.xsom.impl.*; import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; +import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.*; - import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.impl.*; - import com.sun.xml.internal.xsom.impl.parser.*; - import org.xml.sax.Locator; - import org.xml.sax.ContentHandler; - import org.xml.sax.helpers.*; - import java.util.*; - import java.math.BigInteger; +import org.xml.sax.Attributes; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; @@ -435,7 +431,8 @@ break; case 13: { - name = $value; + // with attribute 'name' = $value + name = WhiteSpaceProcessor.collapse($value); $_ngcc_current_state = 12; } break; --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/particle.java 2016-08-25 15:12:09.231913117 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/particle.java 2016-08-25 15:12:09.147911591 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,20 +25,15 @@ /* this file is generated by RelaxNGCC */ package com.sun.xml.internal.xsom.impl.parser.state; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.Attributes; -import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; - import com.sun.xml.internal.xsom.*; - import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.impl.*; - import com.sun.xml.internal.xsom.impl.parser.*; - import org.xml.sax.Locator; - import org.xml.sax.ContentHandler; - import org.xml.sax.helpers.*; - import java.util.*; - import java.math.BigInteger; +import com.sun.xml.internal.bind.WhiteSpaceProcessor; +import com.sun.xml.internal.xsom.impl.*; +import com.sun.xml.internal.xsom.impl.parser.*; +import com.sun.xml.internal.xsom.parser.*; + +import org.xml.sax.Attributes; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; @@ -734,14 +729,16 @@ break; case 14: { + // with attribute 'ref' = $value NGCCHandler h = new qname(this, super._source, $runtime, 118); - spawnChildFromText(h, $value); + spawnChildFromText(h, WhiteSpaceProcessor.collapse($value)); } break; case 24: { + // with attribute 'ref' = $value NGCCHandler h = new qname(this, super._source, $runtime, 130); - spawnChildFromText(h, $value); + spawnChildFromText(h, WhiteSpaceProcessor.collapse($value)); } break; case 0: --- old/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/simpleType.java 2016-08-25 15:12:09.567919219 +0300 +++ new/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/state/simpleType.java 2016-08-25 15:12:09.483917694 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,20 +25,17 @@ /* this file is generated by RelaxNGCC */ package com.sun.xml.internal.xsom.impl.parser.state; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.Attributes; + +import com.sun.xml.internal.bind.WhiteSpaceProcessor; +import com.sun.xml.internal.xsom.*; +import com.sun.xml.internal.xsom.impl.*; import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; +import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.*; - import com.sun.xml.internal.xsom.parser.*; - import com.sun.xml.internal.xsom.impl.*; - import com.sun.xml.internal.xsom.impl.parser.*; - import org.xml.sax.Locator; - import org.xml.sax.ContentHandler; - import org.xml.sax.helpers.*; - import java.util.*; - import java.math.BigInteger; +import java.util.*; +import org.xml.sax.Attributes; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; @@ -373,7 +370,8 @@ switch($_ngcc_current_state) { case 13: { - name = $value; + // with attribute 'name' = $value + name = WhiteSpaceProcessor.collapse($value); $_ngcc_current_state = 12; } break; --- /dev/null 2016-08-21 18:23:34.339542528 +0300 +++ new/jdk/test/javax/xml/bind/xsom/ComplexType.xsd 2016-08-25 15:12:09.819923797 +0300 @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + --- /dev/null 2016-08-21 18:23:34.339542528 +0300 +++ new/jdk/test/javax/xml/bind/xsom/ComplexTypeExtension.xsd 2016-08-25 15:12:10.211930916 +0300 @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- /dev/null 2016-08-21 18:23:34.339542528 +0300 +++ new/jdk/test/javax/xml/bind/xsom/ComplexTypeRestriction.xsd 2016-08-25 15:12:10.591937819 +0300 @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- /dev/null 2016-08-21 18:23:34.339542528 +0300 +++ new/jdk/test/javax/xml/bind/xsom/IdentityConstraint.xsd 2016-08-25 15:12:10.987945011 +0300 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + --- /dev/null 2016-08-21 18:23:34.339542528 +0300 +++ new/jdk/test/javax/xml/bind/xsom/ParticlesAndAttributes.xsd 2016-08-25 15:12:11.403952567 +0300 @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- /dev/null 2016-08-21 18:23:34.339542528 +0300 +++ new/jdk/test/javax/xml/bind/xsom/SimpleType.xsd 2016-08-25 15:12:11.795959687 +0300 @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- /dev/null 2016-08-21 18:23:34.339542528 +0300 +++ new/jdk/test/javax/xml/bind/xsom/TestXSOM.java 2016-08-25 15:12:12.187966807 +0300 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8159240 + * @summary Check that whitespaces within schema types and names are + * collapsed by XSOM parser + * @modules jdk.xml.bind + * jdk.xml.bind/com.sun.xml.internal.xsom + * jdk.xml.bind/com.sun.xml.internal.xsom.parser + * @run testng TestXSOM + * + */ + +import com.sun.xml.internal.xsom.XSSchemaSet; +import com.sun.xml.internal.xsom.parser.XSOMParser; +import java.io.File; +import java.nio.file.Paths; +import javax.xml.parsers.SAXParserFactory; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +public class TestXSOM { + + @Test(dataProvider = "WhitespacedTypes") + public void testWhitespacesCollapse(String schemaFile) throws Exception { + XSOMParser parser = new XSOMParser(SAXParserFactory.newInstance()); + XsomErrorHandler eh = new XsomErrorHandler(); + + parser.setErrorHandler(eh); + parser.parse(getSchemaFile(schemaFile)); + XSSchemaSet sset = parser.getResult(); + + Assert.assertFalse(eh.gotError); + Assert.assertNotNull(sset); + } + + // Get location of schema file located in test source directory + private static File getSchemaFile(String filename) { + String testSrc = System.getProperty("test.src"); + if (testSrc == null) { + testSrc = "."; + } + return Paths.get(testSrc).resolve(filename).toFile(); + } + + @DataProvider(name = "WhitespacedTypes") + private Object[][] dataWhitespacedTypes() { + return new Object[][]{ + {"SimpleType.xsd"}, + {"ComplexType.xsd"}, + {"ComplexTypeExtension.xsd"}, + {"ComplexTypeRestriction.xsd"}, + {"IdentityConstraint.xsd"}, + {"ParticlesAndAttributes.xsd"} + }; + + } + + // Test XSOM error handler + private static class XsomErrorHandler implements ErrorHandler { + + public boolean gotError = false; + + @Override + public void warning(SAXParseException ex) throws SAXException { + System.out.println("XSOM warning:" + ex); + } + + @Override + public void error(SAXParseException ex) throws SAXException { + System.out.println("XSOM error:" + ex); + gotError = true; + } + + @Override + public void fatalError(SAXParseException ex) throws SAXException { + System.out.println("XSOM fatal error:" + ex); + gotError = true; + } + } +} + + +