检查“未找到文件”或解析错误

时间:2020-12-28 14:55:39

标签: sapui5 sap-web-ide

当我尝试运行应用程序时,我从编译器收到一条奇怪的错误消息:

com/example/RequestAccess/view/JobProfileCart.view.xml could not be loaded from ./view/JobProfileCart.view.xml. Check for 'file not found' or parse errors. Reason: Error: Invalid XML: <mvc:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
    controllerName="com.example.RequestAccess.controller.JobProfileCart" xmlns:html="http://www.w3.org/1999/xhtml">
    <Page id="detail" title="{i18n>jobProfileCart}" backgroundDesign="Standard" floatingFooter="true"
        class="sapUiContentPadding sapUiResponsivePadding--header sapUiResponsivePadding--subHeader sapUiResponsivePadding--content sapUiResponsivePadding--footer">
        <headerContent>

我不知道,为什么它抱怨找不到文件:

enter image description here

虽然它存在。

JobProfileCart 的内容也应该是正确的:

<mvc:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
    controllerName="com.example.RequestAccess.controller.JobProfileCart" xmlns:html="http://www.w3.org/1999/xhtml">
    <Page id="detail" title="{i18n>jobProfileCart}" backgroundDesign="Standard" floatingFooter="true"
        class="sapUiContentPadding sapUiResponsivePadding--header sapUiResponsivePadding--subHeader sapUiResponsivePadding--content sapUiResponsivePadding--footer">
        <headerContent>
            <Button icon="sap-icon://user-edit" type="Transparent" press="onPressEdit" ariaLabelledBy="editButtonLabel"/>
        </headerContent>
        <content>
            <f:SimpleForm id="SimpleFormDisplay480" minWidth="1024" maxContainerCols="2" editable="false" layout="ResponsiveGridLayout" labelSpanL="2"
                labelSpanM="2" emptySpanL="0" emptySpanM="0" columnsL="2" columnsM="2">
                <f:content>
                    <Label text="{i18n>id}"/>
                    <Text text="{User>/Id}"/>
                    <Label text="{i18n>name}"/>
                    <Text text="{User>/Surname} {User>/Firstname}"/>
                    <Label text="{i18n>email}"/>
                    <Text text="{User>/Email}"/>
                </f:content>
                <f:layoutData>
                    <FlexItemData shrinkFactor="0" backgroundDesign="Solid" styleClass="sapContrastPlus"/>
                </f:layoutData>
            </f:SimpleForm>
        </content>
        <footer>
            <OverflowToolbar>
                <ToolbarSpacer/>
                <Button type="Accept" enabled="{SendStatus>/enable}" text="Send" press="handleJobProfileSend"/>
            </OverflowToolbar>
        </footer>
    </Page>
</mvc:View>

我做错了什么?

1 个答案:

答案 0 :(得分:3)

您在标题中没有命名空间 "login" 的定义。尝试添加 f

xmlns:f="sap.ui.layout.form"