cancel
Showing results for 
Search instead for 
Did you mean: 

invalid XML in Web IDE

The Web IDE gives an error for my XML file. How can I fix this? Thank you!

<Dialog contentWidth="50%" contentHeight="40%" title="{i18n>createJourneyTitle}" xmlns="sap.m" xmlns:l="sap.ui.layout" xmlns:mvc="sap.ui.core.mvc"><l:VerticalLayout width="100%"> <l:content> <Label text="{i18n>name}:" labelFor="journeyName"/> <Input id="journeyName" required="true"/> <Label text="{i18n>description}:" labelFor="journeyDesc"/> <Input id="journeyDesc"/> </l:content> </l:VerticalLayout> <beginButton> <Button press="onCreate" text="{i18n>createJourneyBtn}"></Button> </beginButton> <endButton> <Button press="onDialogClose" text="{i18n>cancelBtn}"></Button> </endButton> </Dialog>

maheshpalavalli
Active Contributor
0 Kudos

Please format the code, you can use the "code" option in the toolbar and put the code there..

It will be helpful if you put the screenshot of the error as well

boghyon
Product and Topic Expert
Product and Topic Expert
0 Kudos

What is the error message? Does the error persist after reloading Web IDE without cache? At least there is no syntax error in the code you provided here.

0 Kudos
<Dialog class="DialogPadding" contentWidth="50%" contentHeight="40%" title="{i18n>createJourneyTitle}" xmlns="sap.m" xmlns:l="sap.ui.layout"
	xmlns:mvc="sap.ui.core.mvc">
	<l:VerticalLayout class="sapUiContentPadding" width="100%">
		<l:content>
			<Label text="{i18n>name}:" labelFor="journeyName"/>
			<Input id="journeyName" required="true"/>
			<Label text="{i18n>description}:" labelFor="journeyDesc"/>
			<Input id="journeyDesc"/>
		</l:content>
	</l:VerticalLayout>
	<beginButton>
		<Button press="onCreate" text="{i18n>createJourneyBtn}"></Button>
	</beginButton>
	<endButton>
		<Button press="onDialogClose" text="{i18n>cancelBtn}"></Button>
	</endButton>
</Dialog>
0 Kudos

The error message is "Invalid XML"

Accepted Solutions (1)

Accepted Solutions (1)

boghyon
Product and Topic Expert
Product and Topic Expert

Web IDE somehow requires <core:FragmentDefinition xmlns:core="sap.ui.core"> as the root node of the fragment, even though syntactically the XML is perfectly valid. This is a Web IDE issue.

<core:FragmentDefinition xmlns:core="sap.ui.core">
  <Dialog xmlns="sap.m" ...>
  </Dialog>
<core:FragmentDefinition>

The FragmentDefinition is required only if there are multiple root nodes. But Web IDE doesn't seem to care and complaints that the XML is invalid.

_________
Alternatively, you can switch to the Basic XML validator in the project settings.

This also resolves the Invalid XML error but applies to all XML documents.

0 Kudos

Thank you very much!

Answers (0)