Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<xsd:attribute ref="xml:space" use="required"> Reference attribute conversion failed #156

Open
dhbloo opened this issue Jul 28, 2024 · 0 comments

Comments

@dhbloo
Copy link

dhbloo commented Jul 28, 2024

The sample code is as follows, the input file name is AUTOSAR_00048.xsd

func MyTestXsdNormalize(filename string) error {
	doc , err := os.ReadFile(filename)
	if err != nil {
		return err
	}
	doctrees, err := xsd.Normalize(doc)
	if err != nil {
		logger.GetLogger().Warningf("Failed to load schema %q: %v", filename, err)
		return err
	}

	// Write to file a.xml
	f, err := os.Create("AUTOSAR_00048_doctrees.xsd")
	for _, t := range doctrees {
		var result = xmltree.MarshalIndent(t, "", "  ")
		f.Write(result)
	}
	f.Close()
}

It was found that some refs were not converted successfully. For example, after converting the input file, the 180055 line of the output file AUTOSAR_00048_doctrees.xsd in the attachment has the following content:

<xsd:attribute ref="xml:space" use="required" type="xsd:anySimpleType">
where the ref="XML:space" should be replaced.

Here is the output file:
AUTOSAR_00048_doctrees.zip
Here is the input file:
AUTOSAR_00048.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant