---
name: fix-xml-native-html
description: |
Fix native HTML and SVG usage in XML views/fragments that UI5 linter reports but cannot auto-fix. Use this skill when linter outputs:
- `no-deprecated-api` with message "Usage of native HTML in XML Views/Fragments is deprecated"
- `no-deprecated-api` with message "Deprecated use of SVG in XML View or Fragment"
Trigger on: HTML elements in XML views (html:div, html:span, html:a), SVG elements in XML views, xmlns:html namespace usage.
Provides guidance on replacing native HTML with UI5 controls and SVG with UI5 icons or custom controls.
---
# Fix Native HTML and SVG in XML Views/Fragments
This skill fixes native HTML and SVG usage in XML views/fragments that the UI5 linter detects but cannot auto-fix because they require understanding the appropriate UI5 control replacements.
## Linter Rules Handled
| Rule ID | Message Pattern | This Skill's Action |
|---------|-----------------|---------------------|
| `no-deprecated-api` | Usage of native HTML in XML Views/Fragments is deprecated | Replace with UI5 controls |
| `no-deprecated-api` | Deprecated use of SVG in XML View or Fragment | Replace with UI5 icons or custom controls |
## When to Use
Apply this skill when you see linter output like:
```
MyView.view.xml:15:5 error Usage of native HTML in XML Views/Fragments is deprecated no-deprecated-api
MyView.view.xml:25:5 error Deprecated use of SVG in XML View or Fragment no-deprecated-api
```
Run `npx @ui5/linter --details` to get links to documentation about native HTML deprecation.
## Background: Why Native HTML/SVG is Deprecated
Native HTML in XML views was supported via the `sap.ui.core.HTML` control and the `html` namespace. However, this approach:
- Bypasses UI5's control lifecycle and rendering
- Doesn't integrate with UI5 theming
- Can cause accessibility issues
- Is not compatible with modern UI5 strict mode
## Fix Strategy
### 1. Native HTML Elements → UI5 Controls
**Problem**: Using HTML elements via the `html:` namespace.
```xml
Some textLink
```
**Fix Strategy**: Replace with equivalent UI5 controls.
```xml
```
### HTML to UI5 Control Mapping
| HTML Element | UI5 Control | Notes |
|--------------|-------------|-------|
| `` | ``, ``, `` | Use VBox for vertical, HBox for horizontal layout |
| `` | ``, `